Skip to content
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

Command allowing both arguments and subcommands #295

Closed
clns opened this issue Jun 23, 2016 · 2 comments
Closed

Command allowing both arguments and subcommands #295

clns opened this issue Jun 23, 2016 · 2 comments

Comments

@clns
Copy link

clns commented Jun 23, 2016

Currently it's not possible to have subcommands and arbitrary arguments on the same command. Like a "default" or "catch all" subcommand that will receive the args, if no subcommand was matched.

One use case would be to have the root command working with files (thus arbitrary arguments), but also have some subcommands like version. Instead, I would have to add a new subcommand to root that would take the files args, which adds unnecessary typing when using it.

@dnephin
Copy link
Contributor

dnephin commented Jun 23, 2016

PR #284 supports this behaviour. Setting any Args validator would skip legacyArgs() behaviour of not allowing both args and subcommands on the root command.

@n10v
Copy link
Collaborator

n10v commented Jul 24, 2017

Fixed in #284

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants