mirror of
https://salsa.debian.org/freeipa-team/freeipa.git
synced 2025-01-13 01:31:56 -06:00
Command.params are now sorted the same way as Object.params (make user-add prompt for first, last before login)
This commit is contained in:
parent
b6dcd183a6
commit
2357360e2a
@ -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()
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user