diff options
author | Jason Gerard DeRose <jderose@redhat.com> | 2008-09-10 02:02:26 +0000 |
---|---|---|
committer | Jason Gerard DeRose <jderose@redhat.com> | 2008-09-10 02:02:26 +0000 |
commit | 8062075f847199157910114588ea3c27874bdf35 (patch) | |
tree | 219589e91bb9571d1bff29f25469fb8eb9c2f8d7 | |
parent | 0d3be2f421c3cd4044c4d7616d9426ac58a71ce8 (diff) | |
download | freeipa.git-8062075f847199157910114588ea3c27874bdf35.tar.gz freeipa.git-8062075f847199157910114588ea3c27874bdf35.tar.xz freeipa.git-8062075f847199157910114588ea3c27874bdf35.zip |
279: Fixed cli and public.Method re new Command.args attribute
-rw-r--r-- | ipalib/cli.py | 11 | ||||
-rw-r--r-- | ipalib/public.py | 4 |
2 files changed, 6 insertions, 9 deletions
diff --git a/ipalib/cli.py b/ipalib/cli.py index a6bc0f1f..25a0a5b8 100644 --- a/ipalib/cli.py +++ b/ipalib/cli.py @@ -51,12 +51,7 @@ def from_cli(cli_name): class help(public.Application): 'Display help on a command.' - takes_args = ( - public.Option('command', ipa_types.Unicode(), - required=True, - multivalue=True, - ), - ) + takes_args = ['command'] def __call__(self, key): key = str(key) @@ -245,7 +240,7 @@ class CLI(object): def get_usage_iter(self, cmd): yield 'Usage: %%prog %s' % to_cli(cmd.name) - for arg in cmd.takes_args: + for arg in cmd.args(): name = to_cli(arg.name).upper() if arg.multivalue: name = '%s...' % name @@ -254,8 +249,6 @@ class CLI(object): else: yield '[%s]' % name - - def __get_mcl(self): """ Returns the Max Command Length. diff --git a/ipalib/public.py b/ipalib/public.py index 99c51999..437531d6 100644 --- a/ipalib/public.py +++ b/ipalib/public.py @@ -420,6 +420,10 @@ class Attribute(plugable.Plugin): class Method(Attribute, Command): __public__ = Attribute.__public__.union(Command.__public__) + def __init__(self): + Attribute.__init__(self) + Command.__init__(self) + def get_options(self): for option in self.options: yield option |