Open ysndr opened 8 months ago
I was trying to give more space to labels defining -p X Y Z
part as a subsection header, then -p, --point
and the rest of the things inside as items in this group. I like how your second proposed variant looks like though at least on a relatively narrow input. I'll see what it takes to render current adjacent groups like that.
/// ignored comment btw 🤔
At best I can turn those into group_help
. external
fields means it's impl Parser
- can't attach help
to that.
When defining adjacent parsers for mutli value options as described in the docs, the generataed help messages seem a bit misaligned:
parser
```rust #[derive(Debug, Clone, Bpaf)] #[bpaf(options)] pub struct Options { /// flag before to show isse better before: bool, /// ignored comment btw 🤔 #[bpaf(external, many)] point: Vec--long
flags if noshort
was providedI mean, I can tell that
adjacent
is not "specialized" to multi value flags, so i assume it just shows a summary of the group and then the individual components, whatever those are, the formating is a bit odd nonethelessI dont know if this is helpful, but better options might be
1) align summary with other arguments
``` Usage: prog [--before] [-p X Y Z]... [-r] Available options: --before flag before to show isse better -p, --point X Y Z -p, --point Point coordinates X X coordinate of a point Y Y coordinate of a point Z Height of a point above the plane -r, --rotate Face the camera towards the first point -h, --help Prints help information ``` It throws the flag components of the `adjacent` out of alignment with the rest of the arguments but that might be ok (?) since its a sub description anyway.2) first class support for multi value options
``` Usage: prog [--before] [-p X Y Z]... [-r] Available options: --before flag before to show isse better -p, --point X Y Z Point coordinates X X coordinate of a point Y Y coordinate of a point Z Height of a point above the plane -r, --rotate Face the camera towards the first point -h, --help Prints help information ``` maybe a combination of argument and external could work, where bpaf knows that we define an option so we dont need to `point: ()` "fake parser", or an "argument" parser is inferred if the first component is a `point: ()` flag.Another example of wonky alignment in production
``` Usage: flox config [-l | -r | --set