summaryrefslogtreecommitdiffstats
path: root/ipalib/frontend.py
diff options
context:
space:
mode:
Diffstat (limited to 'ipalib/frontend.py')
-rw-r--r--ipalib/frontend.py9
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()