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 defining hidden args and subcommands #231

Closed
kbknapp opened this issue Sep 6, 2015 · 5 comments
Closed

Allow defining hidden args and subcommands #231

kbknapp opened this issue Sep 6, 2015 · 5 comments
Labels
A-help Area: documentation, including docs.rs, readme, examples, etc...
Milestone

Comments

@kbknapp
Copy link
Member

kbknapp commented Sep 6, 2015

Based off an idea in #217

Hidden args and subcommands would not appear in the help messages or suggestions on errror.

They would still appear in usage strings on error.

I'm unsure about allowing them to be seen in groups or not. I'm leaning towards not displaying them in groups....but open to opinions.

@kbknapp kbknapp added T: new feature A-help Area: documentation, including docs.rs, readme, examples, etc... labels Sep 6, 2015
@WildCryptoFox
Copy link

If a verbose flag is present; expand the help to all.

@kbknapp
Copy link
Member Author

kbknapp commented Sep 7, 2015

I think that's a good addition. We could even make that an AppSettings variant (UnhideIfVerbose). I think the initial implementation will just have hidden args/subcommands. Then we can add in the unhiding with verbose, because there's also a few oddities about that one which will make it more difficult to implement, but doing so is non-breaking ;)

@WildCryptoFox
Copy link

I'm not too sure I know why we have the enum AppSettings? Was this created for parsing purposes only? Don't get me wrong, it makes my macro cleaner because CamelCase is better. :-)

@kbknapp
Copy link
Member Author

kbknapp commented Sep 8, 2015

I'm not too sure I know why we have the enum AppSettings? Was this created for parsing purposes only? Don't get me wrong, it makes my macro cleaner because CamelCase is better. :-)

The alternative is what we started with, tons of random methods which take a bool value. This somewhat pollutes the public API space, and makes finding "settings" more difficult. Using an enum creates a single place to look for "settings" which apply to an entire application, or subcommand. It also keeps the public API a little more clean (or at least will in 2.x once all the old methods are removed).

Also, I can't find the link but there is a Rust style guide which favors setting(SettingsEnum) over some_setting(bool).

@kbknapp kbknapp added this to the 1.4 milestone Sep 8, 2015
@kbknapp
Copy link
Member Author

kbknapp commented Sep 8, 2015

The base functionality (i.e. without --verbose unhiding) should be a quick add, therefore I'm throwing this into the 1.4 milestone blocker

@kbknapp kbknapp closed this as completed in 2cab4d0 Sep 9, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-help Area: documentation, including docs.rs, readme, examples, etc...
Projects
None yet
Development

No branches or pull requests

2 participants