sindresorhus/meow











The issue has been solved
Add setting to indicate a flag can be set multiple times #111
sindresorhus posted onGitHub
Currently, if you have:
foo: {
type: 'string'
}
And on the command-line, you do:
$ cli --foo=a
You get 'a'
back, but if you do:
$ cli --foo=a --foo=b
You get and array back ['a', 'b']
.
This is surprising and inconsistent.
Instead, we should allow only one value by default, and add a setting to the flags config to allow multiple for a flag, in which case, it will always return an array, even if there's only one flag.
I imagine it could be something like this:
{
flags: {
foo: {
type: 'string',
multiple: true
}
}
}
Fund this Issue
Rewarded pull request
Add `isMultiple` option for flags #143submitted byulken(118)
Click to copy link
Recent activities