Re: argsparse: allowing --version without mandatory options
Anders Munch <[email protected]>
| Newsgroups | gmane.comp.python.general |
|---|---|
| Message-ID | <PAXPR05MB96639C80A8D9C1ACC0966519B4F8A@PAXPR05MB9663.eurprd05.prod.outlook.com> |
From: [email protected] <[email protected]>: > Don't take this the wrong way, but what, exactly, is a mandatory option? It's a named argument. Positional arguments intermixed with options can get confusing. When you see aprogram.py --a --b c --d --e is 'c' the value for --b, or is it a positional argument? Hard to tell. Using options syntax for everything makes it clearer, because everything has a name: aprogram.py --a --b --c c --d --e Whether an argument is named and whether it's optional are orthogonal traits. Positional arguments can be optional as well, and named arguments ("options") can be mandatory. regards, Anders