cli: Improve 'Unknown options' error

By mentioning the offending command line option, ex:

$ ./virt-install --boot disk
ERROR    Unknown --boot options: ['disk']
This commit is contained in:
Cole Robinson 2019-01-08 11:50:11 -05:00
parent 2f89ecf4a9
commit 0d3babe42b
1 changed files with 2 additions and 1 deletions

View File

@ -1298,7 +1298,8 @@ class VirtCLIParser(metaclass=InitClass):
passed an invalid argument such as --disk idontexist=foo
"""
if optdict:
fail(_("Unknown options %s") % list(optdict.keys()))
fail(_("Unknown --%s options: %s") %
(self.cli_arg_name, list(optdict.keys())))
def _parse(self, inst):
"""