-
I'm working on an interface that has an array of strings. After a lot of poking around, I've settled on:
I've noticed that if I were to use an enum for this and docstring (e.g. clap/clap_builder/src/output/help_template.rs Line 675 in fc55ad0 I'd like to force this behavior, rather than having the values compacted onto one line or forcing in comments I otherwise wouldn't need. Is this possible? To be clear, what I want looks like:
rather than:
From what I can tell, this specific behavior is independent of
But that doesn't end up creating a list, but does change the format of the rest of the help. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
To use long help, we need two things For it to be requested ( clap/clap_builder/src/builder/command.rs Line 5047 in fc55ad0 Long help content to be present clap/clap_builder/src/builder/command.rs Lines 5083 to 5088 in fc55ad0 clap/clap_builder/src/builder/command.rs Lines 5068 to 5081 in fc55ad0 doc strings are split on the first empty line. If there is anything after the split, it is put in the long help for that argument. When long help is being used, possible-values show the long form if any has documentation clap/clap_builder/src/output/help_template.rs Lines 840 to 846 in fc55ad0 clap/clap_builder/src/builder/possible_value.rs Lines 180 to 182 in fc55ad0 So to see long help for possible values, you need
We do not offer a way to force possible values to show in the long form otherwise. The assumption being that it is taking a lot of vertical space, which is limited in CLIs. |
Beta Was this translation helpful? Give feedback.
To use long help, we need two things
For it to be requested (
--help
by default, you can provide your own flag with the long-help action to make it always requested)clap/clap_builder/src/builder/command.rs
Line 5047 in fc55ad0
Long help content to be present
clap/clap_builder/src/builder/command.rs
Lines 5083 to 5088 in fc55ad0