You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Which produces this output, where even though there is more than enough room to print the descriptions after the arguments, it places them on the next line instead.
usage: prog [-h] mode ...
positional arguments:
mode
option-a-here
helpful help
option-b-here
super helpful help
options:
-h, --help show this help message and exit
The program correctly places them on the same line:
usage: prog [-h] [--option-a OPTION_A] [--option-b OPTION_B]
options:
-h, --help show this help message and exit
--option-a OPTION_A helpful help
--option-b OPTION_B super helpful help
usage: prog [-h] mode ...
positional arguments:
mode
option-a-here helpful help
option-b-here super helpful help
options:
-h, --help show this help message and exit
Uh oh!
There was an error while loading. Please reload this page.
Bug report
Bug description:
Consider the following code,
Which produces this output, where even though there is more than enough room to print the descriptions after the arguments, it places them on the next line instead.
While with this code instead,
The program correctly places them on the same line:
I believe this is an error with
HelpFormatter.add_argument()
, where the indent/dedent coming fromHelpFormatter._iter_indented_subactions()
is neither evaluated by_SubParserAction._get_subactions()
nor considered byself._current_indent
.CPython versions tested on:
3.11, 3.12, 3.13
Operating systems tested on:
Linux
Linked PRs
The text was updated successfully, but these errors were encountered: