mirror of
https://github.com/virt-manager/virt-manager.git
synced 2024-12-22 13:34:07 +03:00
cli: Maintain same --print-xml behavior for non virt-install
Don't want it scooping up any nargs
This commit is contained in:
parent
a5d03fdf6e
commit
9b21f27e31
@ -110,10 +110,6 @@ def convert_old_printxml(options):
|
||||
options.xmlonly = options.xmlstep
|
||||
del(options.xmlstep)
|
||||
|
||||
# The case when someone specifies a bare --print-xml
|
||||
if options.xmlonly is True:
|
||||
options.xmlonly = "all"
|
||||
|
||||
|
||||
def convert_old_sound(options):
|
||||
if not options.sound:
|
||||
|
@ -483,10 +483,20 @@ def add_misc_options(grp, prompt=False, replace=False,
|
||||
"with the same name."))
|
||||
|
||||
if printxml:
|
||||
grp.add_argument("--print-xml", nargs="?", dest="xmlonly",
|
||||
default=False, const=True,
|
||||
help=_("Print the generated domain XML rather than create "
|
||||
"the guest."))
|
||||
print_kwargs = {
|
||||
"dest": "xmlonly",
|
||||
"default": False,
|
||||
"help": _("Print the generated domain XML rather than create "
|
||||
"the guest."),
|
||||
}
|
||||
|
||||
if printstep:
|
||||
print_kwargs["nargs"] = "?"
|
||||
print_kwargs["const"] = "all"
|
||||
else:
|
||||
print_kwargs["action"] = "store_true"
|
||||
|
||||
grp.add_argument("--print-xml", **print_kwargs)
|
||||
if printstep:
|
||||
# Back compat, argparse allows us to use --print-xml
|
||||
# for everything.
|
||||
|
Loading…
Reference in New Issue
Block a user