On 10/23/2013 09:57 AM, Chen Hanxiao wrote:
> I don't think either of these approaches are needed. If you
make
> --shareable an undocumented alias of --mode=shareable, then the alias
> handling code will already guarantee that only one of the two spellings
> appears, and you don't have to do any screening here.
>
I think we still need these codes.
We can stop <TAB> to complete it and we can also undocument it.
But if users just type "--mode=readonly --shareable" and press ENTER, we still
need screen here.
No, the generic argument parser that checks that the user passed sane
arguments should have already flagged it before we get into
cmdAttachDisk, since the generic argument parser is what already knows
how to deal with VSH_OT_ALIAS. Inside cmdAttachDisk, you shouldn't have
to check for --shareable at all; the alias code should have already
converted it to canonical form before getting to the specific command.
I'll see if I can help write a patch to fix VSH_OT_ALIAS.
--
Eric Blake eblake redhat com +1-919-301-3266
Libvirt virtualization library
http://libvirt.org