[libvirt] [PATCH] vsh: print help more often

Eric Blake eblake at redhat.com
Wed Oct 21 12:26:01 UTC 2015

On 10/21/2015 02:48 AM, Michal Privoznik wrote:
> So, consider following scenario:
>   virsh # migrate --help
> In this case migrate help is printed out. So far so good.
> However, you start writing this long migrate command (I bet you
> know the arguments  there can get quite long), but then, at some
> point you need to print out the help. Something like this:
>   virsh # migrate --copy-storage-all --migrate-disks --help
> In this specific case you just want to see the format that
> --migrate-disks accepts. So you append --help and expect help to
> be printed out. Well, it will not, because "--help" is taken as
> data to --migrate-disks.

But this is the behavior of ALL applications that use getopt_long():

$ ls --block-size --help
ls: invalid --block-size argument '--help'

NACK; if you use --help in the position where it will be eaten as the
argument to an incomplete long option, that's too bad for you, but we
shouldn't special case it differently than getopt_long().

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

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

More information about the libvir-list mailing list