-
-
Notifications
You must be signed in to change notification settings - Fork 30.7k
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
gh-99735: Handle no arguments when using sub-commands in argparse #99736
Conversation
One particularly effective way of handling sub-commands is to | ||
combine the use of the :meth:`add_subparsers` method with calls to | ||
:meth:`set_defaults` so that each subparser knows which Python | ||
function it should execute. The :meth:`set_defaults` method of the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd recommend keeping the original structure so just the new changes can be more easily reviewed.
One particularly effective way of handling sub-commands is to | |
combine the use of the :meth:`add_subparsers` method with calls to | |
:meth:`set_defaults` so that each subparser knows which Python | |
function it should execute. The :meth:`set_defaults` method of the | |
One particularly effective way of handling sub-commands is to combine the use | |
of the :meth:`add_subparsers` method with calls to :meth:`set_defaults` so | |
that each subparser knows which Python function it should execute. | |
The :meth:`set_defaults` method of the |
combine the use of the :meth:`add_subparsers` method with calls to | ||
:meth:`set_defaults` so that each subparser knows which Python | ||
function it should execute. The :meth:`set_defaults` method of the | ||
main parser is called to handle the case when no subcommand is |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
tiny nit, since 'sub-command' was used above in the same paragraph
main parser is called to handle the case when no subcommand is | |
main parser is called to handle the case when no sub-command is |
Thanks! Closing in favour of #100927 |
This provides a fix to improve the example in the documentation.