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 should have an option to require un-abbreviated option names #60818

Closed
MichaelEdwards mannequin opened this issue Dec 5, 2012 · 4 comments
Closed

argparse should have an option to require un-abbreviated option names #60818

MichaelEdwards mannequin opened this issue Dec 5, 2012 · 4 comments
Labels
easy stdlib Python modules in the Lib dir type-feature A feature request or enhancement

Comments

@MichaelEdwards
Copy link
Mannequin

MichaelEdwards mannequin commented Dec 5, 2012

BPO 16614
Nosy @bitdancer, @cjerdonek
Superseder
  • bpo-14910: argparse: disable abbreviation
  • Files
  • test.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 = <Date 2012-12-08.05:32:22.882>
    created_at = <Date 2012-12-05.13:28:07.468>
    labels = ['easy', 'type-feature', 'library']
    title = 'argparse should have an option to require un-abbreviated option names'
    updated_at = <Date 2012-12-08.05:32:22.881>
    user = 'https://bugs.python.org/MichaelEdwards'

    bugs.python.org fields:

    activity = <Date 2012-12-08.05:32:22.881>
    actor = 'terry.reedy'
    assignee = 'none'
    closed = True
    closed_date = <Date 2012-12-08.05:32:22.882>
    closer = 'terry.reedy'
    components = ['Library (Lib)']
    creation = <Date 2012-12-05.13:28:07.468>
    creator = 'Michael.Edwards'
    dependencies = []
    files = ['28209']
    hgrepos = []
    issue_num = 16614
    keywords = ['easy']
    message_count = 4.0
    messages = ['176981', '176986', '176995', '176997']
    nosy_count = 4.0
    nosy_names = ['bethard', 'r.david.murray', 'chris.jerdonek', 'Michael.Edwards']
    pr_nums = []
    priority = 'low'
    resolution = 'duplicate'
    stage = 'resolved'
    status = 'closed'
    superseder = '14910'
    type = 'enhancement'
    url = 'https://bugs.python.org/issue16614'
    versions = ['Python 3.4']

    @MichaelEdwards
    Copy link
    Mannequin Author

    MichaelEdwards mannequin commented Dec 5, 2012

    When running parse_args, ArgumentParser is liberal in accepting parameters. Partial matches will be accepted as arguments

    (in the included example, --test bob, --tester bob, --testers bob all set the testers argument)

    Perhaps this is documented, but it was super unexpected for me.

    @MichaelEdwards MichaelEdwards mannequin added the stdlib Python modules in the Lib dir label Dec 5, 2012
    @bitdancer
    Copy link
    Member

    It is both documented (http://docs.python.org/dev/library/argparse.html#argument-abbreviations) and an important feature.

    I thought there was an enhancement request in this tracker for making the behavior optional, but I couldn't find it when I looked, so I'm turning this into one. If someone finds that there is already another issue this one can be closed as a dup.

    I'm marking it low priority, though, because I think most people want the ability to abbreviate the option names.

    @bitdancer bitdancer added the easy label Dec 5, 2012
    @bitdancer bitdancer changed the title argparse accepts partial parameters argparse should have an option to require un-abbreviated option names Dec 5, 2012
    @bitdancer bitdancer added the type-feature A feature request or enhancement label Dec 5, 2012
    @cjerdonek
    Copy link
    Member

    David, is bpo-14910 the one you were thinking of?

    @bitdancer
    Copy link
    Member

    It is indeed. And it even has a patch. Don't know how I missed it.

    @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
    easy stdlib Python modules in the Lib dir type-feature A feature request or enhancement
    Projects
    None yet
    Development

    No branches or pull requests

    3 participants