[issue22317] action argument is not documented in argparse add_subparser() docs
New submission from Ubik:
See: https://docs.python.org/2/library/argparse.html#argparse.ArgumentParser.add_...
----------
assignee: docs@python
components: Documentation
messages: 226190
nosy: Ubik, docs@python
priority: normal
severity: normal
status: open
title: action argument is not documented in argparse add_subparser() docs
versions: Python 2.7
_______________________________________
Python tracker
Changes by Ezio Melotti
Changes by Berker Peksag
Changes by Mike Short
Mike Short added the comment:
I am uploading patches for both 2.7 as well as latest (3.x). I only added the action verbiage itself in, but would it be beneficial to also add in links to more detailed descriptions similar to what is done in ArgumentParser.add_argument earlier in the argparse page?
----------
keywords: +patch
Added file: http://bugs.python.org/file37115/argparse.patch
_______________________________________
Python tracker
Changes by Mike Short
Anne Moroney added the comment:
This ticket's patch appears to have already been merged, yet it is open?
On 2.7.9 docs [1], it has the exact language. The tutorial page [2] has a nice description as well. Finding this ticket really helped me understand argparse a bit better, and now I vote to close :).
AnneTheAgile, inspired by CodeTriage
1.[] ; ; ; ; ; ; ; ; ; ; X.15.4. argparse — Parser for command-line options, arguments and sub-commands — Python 2.7.9 documentation
https://docs.python.org/2/library
action - The basic type of action to be taken when this argument is encountered at the command line.
2.[] ; ; ; ; ; ; ; ; ; ; X.Argparse Tutorial — Python 2.7.9 documentation
https://docs.python.org/2/howto/argparse.html
we now specify a new keyword, action, and give it the value "store_true". This means that, if the option is specified, assign the value True to args.verbose. Not specifying it implies False.
3.[] ; ;List of all types of 'action', including customizable ; ; ; ; ; ; ; ; X.15.4. argparse — Parser for command-line options, arguments and sub-commands — Python 2.7.9 documentation
https://docs.python.org/2/library/argparse.html#action
action="store_true"
action='store_false'
action="count"
action='store_const'
action='append'
action='version'
action=CustomFooAction
----------
nosy: +AnneTheAgile
_______________________________________
Python tracker
Roundup Robot added the comment:
New changeset 350b8e109c42 by Berker Peksag in branch '3.4':
Issue #22317: Document the action parameter in ArgumentParser.add_subparsers() docs.
https://hg.python.org/cpython/rev/350b8e109c42
New changeset 4709290253e3 by Berker Peksag in branch 'default':
Issue #22317: Document the action parameter in ArgumentParser.add_subparsers() docs.
https://hg.python.org/cpython/rev/4709290253e3
----------
nosy: +python-dev
_______________________________________
Python tracker
Roundup Robot added the comment:
New changeset 430236ef507b by Berker Peksag in branch '2.7':
Issue #22317: Document the action parameter in ArgumentParser.add_subparsers() docs.
https://hg.python.org/cpython/rev/430236ef507b
----------
_______________________________________
Python tracker
Berker Peksag added the comment:
Thanks for the patch, Mike.
Anne, thank you for the ticket triage! The only missing place was the ArgumentParser.add_subparsers() documentation: https://docs.python.org/3/library/argparse.html#argparse.ArgumentParser.add_...
----------
nosy: +berker.peksag
resolution: -> fixed
stage: needs patch -> resolved
status: open -> closed
_______________________________________
Python tracker
participants (6)
-
Anne Moroney
-
Berker Peksag
-
Ezio Melotti
-
Mike Short
-
Roundup Robot
-
Ubik