This issue tracker has been migrated to GitHub ,
and is currently read-only.
For more information,
see the GitHub FAQs in the Python's Developer Guide.
Created on 2018年04月23日 17:46 by porton, last changed 2022年04月11日 14:58 by admin. This issue is now closed.
| Messages (3) | |||
|---|---|---|---|
| msg315671 - (view) | Author: Victor Porton (porton) | Date: 2018年04月23日 17:46 | |
https://docs.python.org/3/library/argparse.html does not allow abbreviations for subparsers ("subcommands"). It seems inconsistent that long options can be abbreviated but subcommands cannot. Either implement subcommand abbreviations or explain in the docs why there is none. |
|||
| msg315712 - (view) | Author: paul j3 (paul.j3) * (Python triager) | Date: 2018年04月24日 18:34 | |
This issue was raised in https://bugs.python.org/issue12713, argparse: allow abbreviation of sub commands by users A patch was implemented, and then reverted when it was found to be buggy. Subcommands are not parsed the same as long options. Subcommands are actually 'choices' of a positional argument. Trying to allow abbreviations of subcommands allowed them in all 'choices', resulting in backward compatibility problems. I recommend using the suparser alias mechanism instead. (I think this issue should be closed). |
|||
| msg315855 - (view) | Author: Terry J. Reedy (terry.reedy) * (Python committer) | Date: 2018年04月27日 18:55 | |
I am closing this as a duplicate of #12713. Paul, if you think that also should be closed, say so there if you have not done so yet. |
|||
| History | |||
|---|---|---|---|
| Date | User | Action | Args |
| 2022年04月11日 14:58:59 | admin | set | github: 77524 |
| 2018年04月27日 18:55:34 | terry.reedy | set | status: open -> closed superseder: argparse: allow abbreviation of sub commands by users versions: + Python 3.8, - Python 3.6 nosy: + terry.reedy messages: + msg315855 resolution: duplicate stage: resolved |
| 2018年04月25日 01:05:22 | rhettinger | set | assignee: bethard nosy: + bethard |
| 2018年04月24日 18:34:58 | paul.j3 | set | nosy:
+ paul.j3 messages: + msg315712 |
| 2018年04月24日 18:05:48 | brett.cannon | set | title: Subcommand abbreviations -> [argparse] Add subcommand abbreviations |
| 2018年04月23日 17:46:18 | porton | create | |