paul j3 added the comment:
ArgumentGroups and MutuallyExclusiveGroups, as currently defined, won't give
you that kind of usage. I have appended a script that uses UsageGroups, which
I am developing for http://bugs.python.org/issue11588,
to solve this.
It defines 2 'mxg' groups (groups with the xor logic of mutually exclusive
groups), and 1 'any' group. They can be nested.
The resulting usage line is:
usage: PROG [-h] [[--opt1 | --opt2 | --opt3] | [--opt4 --opt5 --opt6]]
Normally '|' is used for simple logical 'or'. But in mutually exclusive groups
it denotes 'xor'. So what should join 'any' lists? You chose ' ', I was using
','. Defining a usage notation that is simple, intuitive, and also flexible,
is not easy.
----------
Added file: http://bugs.python.org/file36095/issue22047.py
_______________________________________
Python tracker <[email protected]>
<http://bugs.python.org/issue22047>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe:
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com