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

allow suggestions for non-root commands #285

Closed
wants to merge 1 commit into from

Conversation

deads2k
Copy link
Contributor

@deads2k deads2k commented May 27, 2016

Suggests were only appearing against the root command, but for nested command structures it makes sense to look for suggestions at the deepest command that was found.

@eparis

@CLAassistant
Copy link

CLAassistant commented May 27, 2016

CLA assistant check
Thank you for your submission, we really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.

@deads2k
Copy link
Contributor Author

deads2k commented May 27, 2016

@eparis Is there a corporate signature for red hat?

@deads2k
Copy link
Contributor Author

deads2k commented May 27, 2016

Well clearly that had unintended consequences.

@deads2k
Copy link
Contributor Author

deads2k commented May 27, 2016

Good unit tests. I want to be able to use suggestions for nested commands, so that rootcommand subcommand misspelled-subsubcommand can get a suggestion. For that to work, I guess I'll need to annotate the Command somehow to indicate that it has no non-flag args.

@juanvallejo want to see what you can do? See the linked pull for usage.

@dnephin
Copy link
Contributor

dnephin commented May 27, 2016

For that to work, I guess I'll need to annotate the Command somehow to indicate that it has no non-flag args.

Sounds related to the PR I just submitted in #284. I also factored out this findSuggestions() function which should make it easier to re-use. Maybe it should be public.

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.

3 participants