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

Divide help message into categories #392

Closed
thymbahutymba opened this issue May 14, 2020 · 3 comments
Closed

Divide help message into categories #392

thymbahutymba opened this issue May 14, 2020 · 3 comments

Comments

@thymbahutymba
Copy link

I would like to make my help message nicer. Since there are a lot of options, I would like to assign a title to a subset of that options. What I mean is something like this:

TITLE1
OPTIONS:
...
...
// Intentional blank line
TITLE2
OPTIONS:
....
....

Or the other way around:

OPTIONS:
TITLE1
...
...
// Intentional blank line
TITLE2
....
....

I'm using flatten in order to keep them separate in the code and then I would like to keep it separate in the help message as well, it is feasible?

@CreepySkeleton
Copy link
Collaborator

What you're asking for is impossible with clap 2.33, therefore, it's impossible with structopt.

Here's the issue for grouping subcommands there. I encourage you to create a similar issue for options.

Anyway, even if this is implemented ever, it will never be backported to 2.33, so structopt will never be able to support it. Sorry.

@thymbahutymba
Copy link
Author

I understand, well what actually I would achieve is to have something that divides multiple options. I've tried to use chained subcommands but it did not worked. So something like that:
./prog command1 --option1.1 --option1.2 command2 --option2.1 --option2.2
The import thing is to have such options splited and easy to understand help message. Is this possible somehow?

@CreepySkeleton
Copy link
Collaborator

Clap can't do that: subcommand are supposed to be exclusive. You use only one at a time.

Although, there's clap-rs/clap#1407 which sounds a lot like what you're asking for.

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

No branches or pull requests

2 participants