Re: [PATCH 5/5]virsh: mark '--shareable' as VSH_OFLAG_IGNORE

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

 



On 10/22/2013 07:13 AM, Chen Hanxiao wrote:

>>>
>>
>> Wow, we've never wanted to hide any option before? I've recall
>> introducing VSH_OT_ALIAS, but there hasn't been anything else?

We've always hidden one spelling that duplicates another, but this is a
case where a boolean option is a duplicate of a non-boolean option, so
I'm not sure if VSH_OT_ALIAS alone does what we want (or maybe it just
means we enhance VSH_OT_ALIAS to be able to express a boolean alias for
a non-boolean default).

> 
> Do you mean we just treat --shareable as an alias for --mode like this:
> 
>     {.name = "shareable",
> -    .type = VSH_OT_BOOL,
> +    .type = VSH_OT_ALIAS,
> -    .help = N_("shareable between domains")
> +    .help = "mode"

If it works.  Maybe even by having it be an alias for .help =
"mode=shareable" rather than just "mode", and teach VSH_OT_ALIAS to
handle '=' within the .help text.

>     },
> 
> But with VSH_OT_ALIAS, auto complete could also get it. 

Command line completion is orthogonal.  It needs fixing anyways (there
were patches posted last month, but I haven't seen any recent action on
them).

Ideally, we want the following:

attach-disk <TAB>

to NOT show --shareable (because it can show --mode instead)

attach-disk --sh <TAB>

would show --shareable (just because it's deprecated and hidden by
default does NOT mean it must be hidden if the user explicitly requests
something that can't complete in any other way)

attach-disk --mode=shareable --sh<TAB>
attach-disk --mode readonly --sh<TAB>

would both complain about no possible completion (because --shareable
has already been eliminated by --mode appearing earlier).

attach-disk --shareable --mo<TAB>

would complain about no possible completion (--shareable implies
--mode=shareable, and --mode can't appear more than once).

But getting that working in this patch series is NOT a prerequisite -
save it for everything else that needs fixing with completion.

> We still need new flag to hide it.

I'm still not convinced we need VSH_OFLAG_IGNORE.  VSH_OT_ALIAS, plus
new logic that lets a boolean be an alias to non-bool=value, ought to be
the way to do it (ie. fix our existing aliasing mechanism, rather than
adding a second aliasing mechanism).

-- 
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature

--
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]