Re: [PATCH] virsh: Add a completer for `domifaddr` --source parameter.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 1/3/20 4:56 PM, Julio Faracco wrote:
> Michal,
> 
> This case of comma separated options, can we include a comma after
> completion by default?
> I.e.:
> 
> virsh # domifaddr 1 --source [TAB]
> agent  arp    lease
> virsh # domifaddr 1 --source ar[TAB]
> virsh # domifaddr 1 --source arp,
> 
> This is easy to test and avoid mistakes.

BTW: --source doesn't accept multiple values.

But anyway, for that we would need to change the way we parse the
argument value because for instance:

  virsh shutdown --mode agent, fedora

is not viewed as valid command by current implementation:

  error: Unknown mode  value, expecting 'acpi', 'agent', 'initctl',
'signal', or 'paravirt'


The fix for this is pretty simple:

index 9315755990..e3daa7d015 100644
--- i/tools/virsh-domain.c
+++ w/tools/virsh-domain.c
@@ -5847 +5847 @@ cmdShutdown(vshControl *ctl, const vshCmd *cmd)
-    while (tmp && *tmp) {
+    while (tmp && *tmp && **tmp) {


But the question is, should we? I mean, this way of accepting multiple
values is pretty unique. I haven't seen any other CLI tool like it
(except for QEMU obviously) so I don't see any behaviour we could mimic.
And I find comma at the end a bit ugly looking.

Michal

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list




[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]

  Powered by Linux