Add two new options types for CLI usage
authorIustin Pop <iustin@google.com>
Mon, 13 Oct 2008 12:17:12 +0000 (12:17 +0000)
committerIustin Pop <iustin@google.com>
Mon, 13 Oct 2008 12:17:12 +0000 (12:17 +0000)
commita84693938be8260657ef54adc9fbb1376a3ed68d
tree2b541af7f45e24850f8b2dbaf253b09ed69a0c6d
parent2d8ed1fe1399a273cedd53be461b0937bb33d497
Add two new options types for CLI usage

For the new 2.0-style command line options, we need to parse strings of
the type:
  ident:key=val[,...]
and
  key=val[,...]

This patch adds two new option builders for these two, which return
(ident, {key=val,}) and {key=val,} for the above two formats. It also
handles specially constructs of type “key” (val is set to True) and
“no_key” (val is set to False, and the ‘no_’ prefix is stripped).

Reviewed-by: imsnah
lib/cli.py
test/ganeti.cli_unittest.py