diff options
author | Jason Gerard DeRose <jderose@redhat.com> | 2008-10-13 21:53:03 -0600 |
---|---|---|
committer | Jason Gerard DeRose <jderose@redhat.com> | 2008-10-13 21:53:03 -0600 |
commit | 2357360e2a077f56f01e9ce8bc5a21d87fea7675 (patch) | |
tree | fd6b5ee1f62bcf0ec7dfc6978799dd6263ba2c9c /ipalib/frontend.py | |
parent | b6dcd183a66ca6056f9d23637de0f12aee15efcc (diff) | |
download | freeipa-2357360e2a077f56f01e9ce8bc5a21d87fea7675.tar.gz freeipa-2357360e2a077f56f01e9ce8bc5a21d87fea7675.tar.xz freeipa-2357360e2a077f56f01e9ce8bc5a21d87fea7675.zip |
Command.params are now sorted the same way as Object.params (make user-add prompt for first, last before login)
Diffstat (limited to 'ipalib/frontend.py')
-rw-r--r-- | ipalib/frontend.py | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/ipalib/frontend.py b/ipalib/frontend.py index 4c6a9c8d2..50e2dd3e0 100644 --- a/ipalib/frontend.py +++ b/ipalib/frontend.py @@ -687,8 +687,15 @@ class Command(plugable.Plugin): (create_param(spec) for spec in self.get_options()), sort=False ) + def get_key(p): + if p.required: + if p.default_from is None: + return 0 + return 1 + return 2 self.params = plugable.NameSpace( - tuple(self.args()) + tuple(self.options()), sort=False + sorted(tuple(self.args()) + tuple(self.options()), key=get_key), + sort=False ) super(Command, self).finalize() |