Issue 33343: [argparse] Add subcommand abbreviations (original) (raw)

Issue33343

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 -> closedsuperseder: argparse: allow abbreviation of sub commands by usersversions: + Python 3.8, - Python 3.6nosy: + terry.reedymessages: + resolution: duplicatestage: resolved
2018-04-25 01:05:22 rhettinger set assignee: bethardnosy: + bethard
2018-04-24 18:34:58 paul.j3 set nosy: + paul.j3messages: +
2018-04-24 18:05:48 brett.cannon set title: Subcommand abbreviations -> [argparse] Add subcommand abbreviations
2018-04-23 17:46:18 porton create