On 12/24/2018 03:35 AM, Lin Ma wrote:
The patch makes --qemu-commandline subprops completion works.

Signed-off-by: Lin Ma <[email protected]>
---
  virtinst/cli.py | 3 ++-
  1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/virtinst/cli.py b/virtinst/cli.py
index 21586b19..3ba81861 100644
--- a/virtinst/cli.py
+++ b/virtinst/cli.py
@@ -494,7 +494,8 @@ def autocomplete(parser):
import argcomplete - parsernames = ["--" + pclass.cli_arg_name for pclass in VIRT_PARSERS]
+    parsernames = ["--" + pclass.cli_arg_name.replace("_", "-")
+                   for pclass in VIRT_PARSERS]
      # pylint: disable=protected-access
      for action in parser._actions:
          for opt in action.option_strings:


Good catch. But looks like there's some other incorrect cli_arg_name usages as well. Can you add something like

@classmethod
def cli_flag_name(cls):
    return "--" + cls.cli_arg_name.replace("_", "-")

And convert the other incorrect cli_arg_name users to it. For example the underscore printed here:

$ ./virt-xml --qemu-commandline=help
--qemu_commandline options:
  args
  clearxml
  env


Thanks,
Cole

_______________________________________________
virt-tools-list mailing list
[email protected]
https://www.redhat.com/mailman/listinfo/virt-tools-list

Reply via email to