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

Support OnlySubCommands for validation of positional arguments #635

Closed
wants to merge 2 commits into from
Closed

Support OnlySubCommands for validation of positional arguments #635

wants to merge 2 commits into from

Conversation

nak3
Copy link
Contributor

@nak3 nak3 commented Feb 17, 2018

Currently, suggestions for "unknown command" are not working for
subcommands.

This patch supports new validation of positional arguments as
OnlySubCommands. It accepts only subcommands if enabled, and also
findSuggestions() will be called.

Fixes #636

README.md Outdated
@@ -392,6 +392,7 @@ The following validators are built in:
- `NoArgs` - the command will report an error if there are any positional args.
- `ArbitraryArgs` - the command will accept any args.
- `OnlyValidArgs` - the command will report an error if there are any positional args that are not in the `ValidArgs` field of `Command`.
- `OnlySubCommands` - the command will report an error if if any args are included except for subcommands.
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Typo error in an error if if any args

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you @Perif Updated.

nak3 added 2 commits May 31, 2018 10:32
Currently, suggestions for "unknown command" are not working for
subcommands.

This patch supports new validation of positional arguments as
`OnlySubCommands`. It accepts only subcommands if enabled, and also
`findSuggestions()` will be called.
@github-actions
Copy link

This PR is being marked as stale due to a long period of inactivity

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

Successfully merging this pull request may close these issues.

RFE: Support OnlySubCommands arg validation to make subcommand get suggestions
2 participants