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
Handle no arguments when using sub-commands in argparse #99735
Comments
Originally
Then we wouldn't have to define a Whether we use |
…honGH-100927) (cherry picked from commit 6aab56f) Co-authored-by: Patricio Paez <nospam@pp.com.mx>
…honGH-100927) (cherry picked from commit 6aab56f) Co-authored-by: Patricio Paez <nospam@pp.com.mx>
Documentation
The example that shows the use of sub-commands and set_defaults to dispatch a function for each sub-command, fails when there are no command line arguments:
AttributeError: 'Namespace' object has no attribute 'func'
A pull request is provided that adds one line to handle that case and an explanation in the documentation.
Linked PRs
The text was updated successfully, but these errors were encountered: