summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--ipalib/cli.py5
-rw-r--r--ipalib/plugins/f_user.py8
2 files changed, 7 insertions, 6 deletions
diff --git a/ipalib/cli.py b/ipalib/cli.py
index aae4e31c7..378cc4c16 100644
--- a/ipalib/cli.py
+++ b/ipalib/cli.py
@@ -321,7 +321,8 @@ class CLI(object):
usage=self.get_usage(cmd),
)
for option in cmd.options():
- parser.add_option('--%s' % to_cli(option.name),
+ parser.add_option('--%s' % to_cli(option.cli_name),
+ dest=option.name,
metavar=option.type.name.upper(),
help=option.doc,
)
@@ -368,7 +369,7 @@ class CLI(object):
def get_usage_iter(self, cmd):
yield 'Usage: %%prog [global-options] %s' % to_cli(cmd.name)
for arg in cmd.args():
- name = to_cli(arg.name).upper()
+ name = to_cli(arg.cli_name).upper()
if arg.multivalue:
name = '%s...' % name
if arg.required:
diff --git a/ipalib/plugins/f_user.py b/ipalib/plugins/f_user.py
index ff459b3da..22fb8a278 100644
--- a/ipalib/plugins/f_user.py
+++ b/ipalib/plugins/f_user.py
@@ -55,9 +55,10 @@ class user(frontend.Object):
User object.
"""
takes_params = (
- 'givenname',
- 'sn',
+ Param('givenname', cli_name='firstname'),
+ Param('sn', cli_name='lastname'),
Param('uid',
+ cli_name='user',
primary_key=True,
default_from=lambda givenname, sn: givenname[0] + sn,
normalize=lambda value: value.lower(),
@@ -78,7 +79,7 @@ class user_add(crud.Add):
"""args[0] = uid of the user to add
kw{container} is the location in the DIT to add the user, not
required
- kw otherwise contains all the attributes
+ kw otherwise contains all the attributes
"""
# FIXME: ug, really?
if not kw.get('container'):
@@ -296,4 +297,3 @@ class user_unlock(frontend.Command):
if result:
print "User unlocked"
api.register(user_unlock)
-