-
-
Notifications
You must be signed in to change notification settings - Fork 151
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Rewrite flags input #63
Rewrite flags input #63
Conversation
Awesome! This looks much much better! @sindresorhus Might be a good idea to update aliases as well. Or maybe we should create a new one? |
759fa01
to
2730a67
Compare
I found an issue. If I use: flags: {
foo: {
type: 'boolean',
alias: 'f'
}
} And pass in |
I'm also not sure about the special const cli = meow({
arguments: 'string',
flags: {
foo: {
type: 'boolean',
alias: 'f'
}
}
}); Maybe also call it |
Agree about |
Re issue with an alias, I couldn't reproduce it. I added and pushed a test to be sure and demo it. Plus, several other existing tests validate the alias functionality. |
Weird. I'll try to create a failing test. |
Ah, it's because I have the options as the second argument, so they're not read at all. const cli = meow(`
Usage
$ internal-ip
`, {
flags: {
foo: {
type: 'boolean',
alias: 'f'
}
}
}); The above should be supported too. |
Added support for specifying options both as first and second arguments. |
@vadimdemedes Sorry totally forgot about this. I'll write some docs for it tomorrow. |
@sindresorhus No probs ;) Glad it got merged in! |
Uses minimist-options to define minimist options for flags more comfortably.
Before:
After:
Note to @sindresorhus: removed the docs from readme, because you wanted to bundle args documentation inside.