[libvirt] [PATCH 08/11] tools: Provide bash autompletion file

Eric Blake eblake at redhat.com
Fri Nov 10 14:57:07 UTC 2017


On 11/10/2017 05:01 AM, Michal Privoznik wrote:

> 
> So while implementing this I realized it will not fly. At ARGV level it
> is impossible to tell apart "--domain" and "--domain ".

But it is not impossible to tell apart '"--domain"' (one arg) and
'"--domain" ""' (two args).  If you have trailing whitespace, then tack
on an empty argument.

> But the
> difference is important, because in the first case we want to offer list
> of all --options, while in the second case we want to call the --domain
> completer. 

Yes, the difference between one argument and two is significant - the
completion should always be done on the last argument, but the last
argument needs to be the empty string if it is not in the middle of a word.

-- 
Eric Blake, Principal Software Engineer
Red Hat, Inc.           +1-919-301-3266
Virtualization:  qemu.org | libvirt.org

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 619 bytes
Desc: OpenPGP digital signature
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20171110/ab8b28b1/attachment-0001.sig>


More information about the libvir-list mailing list