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

Uniformize help messages formatting #956

Open
AlexVCaron opened this issue Mar 28, 2024 · 0 comments
Open

Uniformize help messages formatting #956

AlexVCaron opened this issue Mar 28, 2024 · 0 comments

Comments

@AlexVCaron
Copy link
Contributor

While working on #766, we had a discussion on how to format the content of help messages for the scripts. In some of them, the lines are cut at a certain length, in others not. Indentation and grouping is not uniform as well. It's not that it's a problem, but there is work in the way to do it, so I share it here.

As of now, in the argparse package, there is some way to define the formatting for script's help messages. It quite basic : either display as written, do minor formatting, add defaults or add types. However, there is works on a more flexible way to customize this : python/cpython#24377. Using this as the formatter_class for the scripts would allow us to auto-set indentation for arguments, line-wrapping and some other formats.

It's near completion, which seems to be lagged by reviews from Python officials. I suppose this is good though, as the code has passed a lot of barriers and seems to be ready for merge soon. Let's keep an eye on this.

P.S. : We could already start using the ArgumentDefaultsHelpFormatter, it adds the defaults where needed in the help, no need to write the format string anymore.

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

1 participant