diff options
-rw-r--r-- | ipalib/cli.py | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/ipalib/cli.py b/ipalib/cli.py index 365eea20..62528034 100644 --- a/ipalib/cli.py +++ b/ipalib/cli.py @@ -325,11 +325,16 @@ class CLI(object): usage=self.get_usage(cmd), ) for option in cmd.options(): - parser.add_option('--%s' % to_cli(option.cli_name), + o = optparse.make_option('--%s' % to_cli(option.cli_name), dest=option.name, metavar=option.type.name.upper(), help=option.doc, ) + if isinstance(option.type, ipa_types.Bool): + o.action = 'store_true' + o.default = option.default + o.type = None + parser.add_option(o) return parser def parse_globals(self, argv=sys.argv[1:]): |