Re: [PATCH 2/2] Indicate freecell --cellno is optional

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

 



On 03/22/2012 01:59 PM, Dave Allan wrote:
> ---
>  tools/virsh.c |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
> 
> diff --git a/tools/virsh.c b/tools/virsh.c
> index 9e5c9b2..d9cff0c 100644
> --- a/tools/virsh.c
> +++ b/tools/virsh.c
> @@ -4742,7 +4742,7 @@ static const vshCmdInfo info_freecell[] = {
>  };
> 
>  static const vshCmdOptDef opts_freecell[] = {
> -    {"cellno", VSH_OT_INT, 0, N_("NUMA cell number")},
> +    {"cellno", VSH_OT_INT, VSH_OFLAG_REQ, N_("NUMA cell number")},

NACK.  VSH_OFLAG_REQ means required, absence of that flag (ie. using 0
for the flag) means optional.  This patch would break the command by
requiring a --cellno argument, even with --all.

This is the current 'virsh help freecell' output, without your patch:

$ virsh help freecell
  NAME
    freecell - NUMA free memory

  SYNOPSIS
    freecell [--cellno <number>] [--all]

  DESCRIPTION
    display available free memory for the NUMA cell.

  OPTIONS
    --cellno <number>  NUMA cell number
    --all            show free memory for all NUMA cells

It shows that both --cellno and --all are optional; however, what it
does not show (and cannot show, without a lot more work throughout
virsh), is the notion of mutual exclusion (that is, there is no trivial
way to make virsh help output the {} operators to show the alternation
that the virsh.pod has by hand).

-- 
Eric Blake   eblake@xxxxxxxxxx    +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]