You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+7-7Lines changed: 7 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -44,8 +44,8 @@ Args.alias({
44
44
// Optionally specify a list of possible flag values (autocreates the flag if it does not already exist, updates options if it does)
45
45
Args.setOptions('name', 'john', 'jane')
46
46
47
-
//Restrict a flag to a single value (applies when the same flag is passed multiple times).
48
-
Args.single('c')
47
+
//Allow a flag to accept multiple values (applies when the same flag is defined multiple times).
48
+
Args.allowMultiple('c')
49
49
50
50
// Do not allow unrecognized flags
51
51
Args.disallowUnrecognized()
@@ -91,7 +91,7 @@ Args.configure({
91
91
},
92
92
c: {
93
93
default:'test',
94
-
single:true
94
+
allowMultiple:true
95
95
},
96
96
input: {
97
97
alias:'in'
@@ -146,7 +146,7 @@ The following attributes configuration attributes can be set for each flag:
146
146
-`type` - The data type. Supports primitives like `Boolean` or their text (typeof) equivalent (i.e. "`boolean`").
147
147
-`alias` - A string representing an alternative name for the flag.
148
148
-`aliases` - Support for multiple aliases.
149
-
-`single` - If a flag is specified more than one, only a single value (the last one specified) will be used.
149
+
-`allowMultiple` - If a flag is specified more than once, capture all values (instead of only the last one specified).
150
150
-`options` - An array of valid values for the flag.
151
151
152
152
### configure({...})
@@ -162,7 +162,7 @@ Args.configure({
162
162
default: value,
163
163
type: string_or_primitive, // example: 'boolean' or Boolean
164
164
alias: string,
165
-
single:true/false,
165
+
allowMultiple:true/false,
166
166
options: [...]
167
167
}, {
168
168
...
@@ -194,9 +194,9 @@ Identify aliases for recognized flags.
194
194
195
195
Automatically executes `recognize` for any flags specified amongst the defaults.
196
196
197
-
### single('flag1', 'flag2', ...)
197
+
### allowMultiple('flag1', 'flag2', ...)
198
198
199
-
By default, a flag can be passed in multiple times providing multiple values for the same flag. This method can be used to retrieve only one value (the last one specified).
199
+
By default, if the same flag is defined multiple times, only the last value is recognized. Setting `allowMultiple` on a flag will capture all values (as an array).
200
200
201
201
Automatically executes `recognize` for any flags specified amongst the defaults.
0 commit comments