Author paul.j3
Recipients Sam.Kerr, paul.j3
Date 2014-07-25.22:52:22
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1406328742.64.0.342417012148.issue22047@psf.upfronthosting.co.za>
In-reply-to
Content
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.
History
Date User Action Args
2014-07-25 22:52:22paul.j3setrecipients: + paul.j3, Sam.Kerr
2014-07-25 22:52:22paul.j3setmessageid: <1406328742.64.0.342417012148.issue22047@psf.upfronthosting.co.za>
2014-07-25 22:52:22paul.j3linkissue22047 messages
2014-07-25 22:52:22paul.j3create