Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

1
  • For anyone reading this answer (which is the official answer according to bugs.python.org/issue16308#msg350415 and should therefore be upvoted), I suggest adding also metavar='cmd' to add_subparsers. Without metavar: usage: jobs.py [-h] {run,list,show}. With metavar: usage: jobs.py [-h] cmd. As the error message when no cmd is provided is "error: the following arguments are required: cmd", I prefer to have cmd explicitly displayed in usage. The available choices for cmd are displayed in the full help anyway. Commented May 11, 2022 at 10:08