Skip to content

allow suggestions for non-root commands#285

Closed
deads2k wants to merge 1 commit into
spf13:masterfrom
deads2k:suggestions
Closed

allow suggestions for non-root commands#285
deads2k wants to merge 1 commit into
spf13:masterfrom
deads2k:suggestions

Conversation

@deads2k
Copy link
Copy Markdown
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
Copy Markdown

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
Copy Markdown
Contributor Author

deads2k commented May 27, 2016

@eparis Is there a corporate signature for red hat?

@deads2k
Copy link
Copy Markdown
Contributor Author

deads2k commented May 27, 2016

Well clearly that had unintended consequences.

@deads2k
Copy link
Copy Markdown
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
Copy Markdown
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