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

argparse incorrectly shows help string on a new line in case of long command string #87041

Open
DiPaolo mannequin opened this issue Jan 9, 2021 · 2 comments
Open

argparse incorrectly shows help string on a new line in case of long command string #87041

DiPaolo mannequin opened this issue Jan 9, 2021 · 2 comments
Labels
3.8 only security fixes 3.9 only security fixes 3.10 only security fixes stdlib Python modules in the Lib dir type-bug An unexpected behavior, bug, or error

Comments

@DiPaolo
Copy link
Mannequin

DiPaolo mannequin commented Jan 9, 2021

BPO 42875
Nosy @rhettinger, @DiPaolo
PRs
  • bpo-42875: fix incorrect indent of long sub-commands #24177
  • Files
  • argparse-indent-sample.py
  • Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

    Show more details

    GitHub fields:

    assignee = None
    closed_at = None
    created_at = <Date 2021-01-09.14:34:59.534>
    labels = ['3.8', 'type-bug', 'library', '3.9', '3.10']
    title = 'argparse incorrectly shows help string on a new line in case of long command string'
    updated_at = <Date 2021-01-22.19:25:32.221>
    user = 'https://github.com/DiPaolo'

    bugs.python.org fields:

    activity = <Date 2021-01-22.19:25:32.221>
    actor = 'paul.j3'
    assignee = 'none'
    closed = False
    closed_date = None
    closer = None
    components = ['Library (Lib)']
    creation = <Date 2021-01-09.14:34:59.534>
    creator = 'DiPaolo'
    dependencies = []
    files = ['49730']
    hgrepos = []
    issue_num = 42875
    keywords = ['patch']
    message_count = 2.0
    messages = ['384728', '385508']
    nosy_count = 3.0
    nosy_names = ['rhettinger', 'paul.j3', 'DiPaolo']
    pr_nums = ['24177']
    priority = 'normal'
    resolution = None
    stage = 'patch review'
    status = 'open'
    superseder = None
    type = 'behavior'
    url = 'https://bugs.python.org/issue42875'
    versions = ['Python 3.8', 'Python 3.9', 'Python 3.10']

    @DiPaolo
    Copy link
    Mannequin Author

    DiPaolo mannequin commented Jan 9, 2021

    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

    @DiPaolo DiPaolo mannequin added 3.9 only security fixes stdlib Python modules in the Lib dir type-bug An unexpected behavior, bug, or error 3.7 (EOL) end of life 3.8 only security fixes 3.10 only security fixes and removed 3.7 (EOL) end of life labels Jan 9, 2021
    @paulj3
    Copy link
    Mannequin

    paulj3 mannequin commented Jan 22, 2021

    @ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Labels
    3.8 only security fixes 3.9 only security fixes 3.10 only security fixes stdlib Python modules in the Lib dir type-bug An unexpected behavior, bug, or error
    Projects
    Status: Bugs
    Development

    No branches or pull requests

    0 participants