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
make indentation of descriptions configurable or even automatic #258
Comments
This seems like a reasonable request, and the first part would be rather easy as you say. The second suggestion might be a good deal more difficult though, I don't think that the Wadler pretty printing libraries actually support layouts like this. |
It should not matter. We just have to calculate the common maximum of /everything/ that goes in the left column (up to a user defined limit) so we can use this number as input to whatever combinator creates the option/command listings. Assuming that optparse-applicative internally works with a deep embedding i.e. builds some kind of "syntax" tree, this would amount to an extra pass over the tree prior to creating the help Hm, implementing this might be fun. I think i will give it a try... |
Yeah I wasn't saying it's impossible, just trickier that it would be if there was more native support for it in the pp library. Cool, feel free to have a crack. |
Closing as this has been addressed with #407 and will be in 0.17. |
In the help output, the description text for an option or command is currently indented to a hard-coded value of 24 (plus the initial indent of 2). This tends to waste horizontal space if the option or command names are short.
It would nice (and probably easy) to add a new prefDescIndent :: Int field to ParserPrefs.
Even nicer would be to determine this automatically from the maximum length of the option and command names, which is what the help formatter of GetOpt does. It might be challenging to implement this in a compositional way, since we want to have the same indentation for all groups of items. For example, instead of
we would get:
The text was updated successfully, but these errors were encountered: