Branch: refs/heads/master
Home: https://github.com/openSUSE/osc2
Commit: 1ab7b4c3c62145c0b9b3cb12e9f751911ba93a4e
https://github.com/openSUSE/osc2/commit/1ab7b4c3c62145c0b9b3cb12e9f751911ba9...
Author: Marcus Huewe
Date: 2012-08-16 (Thu, 16 Aug 2012)
Changed paths:
M osc/cli/description.py
Log Message:
-----------
- osc.cli.description: refactored add_arguments code in class CommandDescription
moved code for options and subcommands into new methods
Commit: dd89fd4ee973ff087821d569dd1c924d555c976b
https://github.com/openSUSE/osc2/commit/dd89fd4ee973ff087821d569dd1c924d555c...
Author: Marcus Huewe
Date: 2012-08-16 (Thu, 16 Aug 2012)
Changed paths:
M osc/cli/description.py
Log Message:
-----------
- osc.cli.description: added support for mutually exclusive options
Mutually exclusive options can be specified like the following:
class SomeCommand(CommandDescription):
...
opt_foo = Option('f', 'foo', ...)
opt_bar = Option('b', 'bar', ...)
opt_optx = Option('x', 'optx', ...)
opt_opty = Option('y', 'opty', ...)
# the groups do not have to be numbered
# they can be named "mutex_<some str>"
mutex_group1 = [opt_foo, opt_bar]
mutex_group2 = [opt_optx, opt_opty]
Now "--foo", "--bar" and "--optx", "--opty" are mutually exclusive.
Note: an option can only belong to at most one mutex group (that's
an argparse limitation).
Compare: https://github.com/openSUSE/osc2/compare/0ba29b95fe7c...dd89fd4ee973