Message307760
On 2017-12-06 19:43, paul j3 wrote:
> With one flag but not its argument, I get the error that you display. That has nothing to do with the grouping.
>
> 0932:~/mypy/argdev$ python3 issue18943.py --ptz-get-status
> usage: issue18943.py [-h]
> (--device-get-capabilities | --ptz-absolute-move x y z | --ptz-get-status MEDIA_PROFILE)
> issue18943.py: error: argument --ptz-get-status: expected one argument
In my example I pasted, I had hardcoded arguments:
```
pprint.pprint(parser.parse_args(['--ptz-get-status']))
``
I expected `python myscript.py --ptz-get-status` to work, because default value is set.
I do not compute that "With one flag but not its argument", sorry. It has default argument set, shoudn't that work?
Thanks! |
|
Date |
User |
Action |
Args |
2017-12-06 17:58:07 | talkless | set | recipients:
+ talkless, pitrou, bethard, paul.j3, wolma, louielu |
2017-12-06 17:58:07 | talkless | link | issue18943 messages |
2017-12-06 17:58:07 | talkless | create | |
|