Vincas Dargis <vin...@gmail.com> added the comment:

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!

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue18943>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to