Repository navigation
bpo-21150: add quick link/summary table to the top of argparse documentation #12005
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
Changes from 1 commit
82ef37b
5e75aa3
427d6f6
3a78f0d
2d96d83
95984c3
da29e79
8b35e39
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
- Loading branch information
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -37,12 +37,12 @@ The :mod:`argparse` module's support for command-line interfaces is built from t | |
| The :class:`argparse.ArgumentParser` creates a new :class:`ArgumentParser` object. Commonly used arguments include `prog`_, `description`_, and `formatter_class`_. For example, the user can create an instance of :class:`ArgumentParser` through the following:: | ||
|
|
||
| >>> parser = argparse.ArgumentParser(prog='PROG', description='DESC', | ||
| ... formatter_class=argparse.RawDescriptionHelpFormatter) | ||
| ... formatter_class=argparse.RawDescriptionHelpFormatter) | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This line is too long (spawns an horizontal scrollbar in the example box, in the rendered HTML), can you please use hanging indentation, like: parser = argparse.ArgumentParser(
prog="PROG",
description="DESC",
formatter_class=argparse.RawDescriptionHelpFormatter,
) |
||
|
|
||
| The :func:`ArgumentParser.add_argument` is a function that is used to define how a single command-line argument should be parsed. Commonly used arguments include `name or flags`_, `action`_, `default`_, `type`_, `required`_, and `help`_. An example of the function :func:`ArgumentParser.add_argument` is as follows:: | ||
|
|
||
| >>> parser.add_argument('-v', '--verbose', action='store_true', | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. For consistency please also use hanging indentation here, with a single argument per line. |
||
| ... help='Show various debugging information') | ||
| ... help='Show various debugging information') | ||
|
|
||
|
JulienPalard marked this conversation as resolved.
|
||
|
|
||
| Basic Usage of :func:`add_argument` | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.