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 grouping of valid options in help message (a-la docopt or getopts style) #158

Closed
kbknapp opened this issue Jul 15, 2015 · 3 comments
Closed
Labels
A-help Area: documentation, including docs.rs, readme, examples, etc... S-waiting-on-decision Status: Waiting on a go/no-go before implementing

Comments

@kbknapp
Copy link
Member

kbknapp commented Jul 15, 2015

Instead of breaking up each type of argument into, FLAGS, OPTIONS and ARGS, add an option which combines them all into a single OPTIONS section a-la docopt or getopts style.

Perhaps a App::grouped_help(bool)? Unless someone has a better name :P

@kbknapp kbknapp added feature request S-waiting-on-decision Status: Waiting on a go/no-go before implementing A-help Area: documentation, including docs.rs, readme, examples, etc... labels Jul 15, 2015
@kbknapp kbknapp changed the title Allow grouping of options in help message (a-la docopt or getopts style) Allow grouping of valid options in help message (a-la docopt or getopts style) Jul 15, 2015
@severen
Copy link
Contributor

severen commented Jul 15, 2015

Isn't naming the method App::grouped_help somewhat arbitrary? Perhaps naming it App::unified_args or App::unified_options would be better?

Or perhaps it should just be the default, only behaviour?

@kbknapp
Copy link
Member Author

kbknapp commented Jul 15, 2015

I don't want to make the default behavior yet because that'd be too drastic a change without bumping the major version. But I can include the option. I like your naming better of unified.

Whats your opinion in the usage strings? Currently, with a program that has optional flags, options, and args it would read program [FLAGS] [OPTIONS] [ARGS]. When this setting is turned on, should flags and options be collapsed into just [OPTIONS], or should all three be collapsed?

As for precedents, I believe docopt combines what clap calls flags and options, but does separate out args (in usage strings at least).

@kbknapp
Copy link
Member Author

kbknapp commented Jul 16, 2015

@SShrike This will be implemented via #160 although it's not the default, it should still be more to your liking ;)

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... S-waiting-on-decision Status: Waiting on a go/no-go before implementing
Projects
None yet
Development

No branches or pull requests

2 participants