mirror of
https://github.com/virt-manager/virt-manager.git
synced 2025-01-11 05:17:59 +03:00
cli: Tweak introspection sorting a bit
- Put clearxml at the very top, because it's a bit special and I don't like it mixed in with the interesting settings - Put address.X at the top, after clearxml, because there's a lot of settings and I'd like to keep them away from the users' visual field
This commit is contained in:
parent
a274cc97cd
commit
5f4b781580
@ -1207,8 +1207,16 @@ class VirtCLIParser(metaclass=_InitClass):
|
||||
"""
|
||||
Print out all _param names, triggered via ex. --disk help
|
||||
"""
|
||||
def _sortkey(virtarg):
|
||||
prefix = ""
|
||||
if virtarg.cliname == "clearxml":
|
||||
prefix = "0"
|
||||
if virtarg.cliname.startswith("address."):
|
||||
prefix = "1"
|
||||
return prefix + virtarg.cliname
|
||||
|
||||
print("%s options:" % cls.cli_flag_name())
|
||||
for arg in sorted(cls._virtargs, key=lambda p: p.cliname):
|
||||
for arg in sorted(cls._virtargs, key=_sortkey):
|
||||
print(" %s" % arg.cliname)
|
||||
print("")
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user