classification
Title: argparse incorrectly shows help string on a new line in case of long command string
Type: behavior Stage: patch review
Components: Library (Lib) Versions: Python 3.10, Python 3.9, Python 3.8
process
Status: open Resolution:
Dependencies: Superseder:
Assigned To: Nosy List: DiPaolo, paul.j3, rhettinger
Priority: normal Keywords: patch

Created on 2021-01-09 14:34 by DiPaolo, last changed 2021-01-11 22:17 by DiPaolo.

Files
File name Uploaded Description Edit
argparse-indent-sample.py DiPaolo, 2021-01-09 14:34
Pull Requests
URL Status Linked Edit
PR 24177 open DiPaolo, 2021-01-09 18:21
Messages (1)
msg384728 - (view) Author: Pavel Ditenbir (DiPaolo) * Date: 2021-01-09 14:34
Steps to reproduce.

Run the attached script:
$ python3 argparse-indent-sample.py --help

The output is:
usage: argparse-indent-sample.py [-h] CMD ...

optional arguments:
  -h, --help           show this help message and exit

service:
  CMD                  command to use
    add                add something
    remove             remove something
    a-very-long-command
                       command that does something

Expected output is:
usage: argparse-indent-sample.py [-h] CMD ...

optional arguments:
  -h, --help           show this help message and exit

service:
  CMD                    command to use
    add                  add something
    remove               remove something
    a-very-long-command  command that does something
History
Date User Action Args
2021-01-11 22:17:23DiPaolosetversions: - Python 3.6, Python 3.7
2021-01-11 22:09:46DiPaolosetversions: + Python 3.6, Python 3.7, Python 3.8, Python 3.10
2021-01-10 14:36:26shihai1991setnosy: + rhettinger, paul.j3
2021-01-09 18:21:34DiPaolosetkeywords: + patch
stage: patch review
pull_requests: + pull_request23003
2021-01-09 14:34:59DiPaolocreate