Message224010
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. |
|
Date |
User |
Action |
Args |
2014-07-25 22:52:22 | paul.j3 | set | recipients:
+ paul.j3, Sam.Kerr |
2014-07-25 22:52:22 | paul.j3 | set | messageid: <1406328742.64.0.342417012148.issue22047@psf.upfronthosting.co.za> |
2014-07-25 22:52:22 | paul.j3 | link | issue22047 messages |
2014-07-25 22:52:22 | paul.j3 | create | |
|