From: Eric Blake Date: Tue, 29 Jun 2010 22:14:57 +0000 (-0600) Subject: virsh: tweak help output for VSH_OT_DATA X-Git-Tag: v0.8.2~7 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=26752f3be1da9d2efb3f56c387db8c1dec42f830;p=thirdparty%2Flibvirt.git virsh: tweak help output for VSH_OT_DATA https://bugzilla.redhat.com/show_bug.cgi?id=609044 complained that 'virsh help pool-create-as' didn't document the shortcut that you can do 'virsh pool-create-as $name $type --target $target' rather than having to supply the four optional source- arguments in order to fill out the necessary positional arguments. This one-liner changes the help output to hopefully make this more obvious: NAME pool-create-as - create a pool from a set of args SYNOPSIS pool-create-as [--print-xml] [] [] [] [] [] [--source-format ] DESCRIPTION Create a pool. OPTIONS [--name] name of the pool --print-xml print XML document, but don't define/create [--type] type of the pool [--source-host] source-host for underlying storage [--source-path] source path for underlying storage [--source-dev] source device for underlying storage [--source-name] source name for underlying storage [--target] target for underlying storage --source-format format for underlying storage * tools/virsh.c (vshCmddefHelp): Make it more obvious that data arguments may, but not must, be specified by option leaders. --- diff --git a/tools/virsh.c b/tools/virsh.c index de4876f784..e07fef3e89 100644 --- a/tools/virsh.c +++ b/tools/virsh.c @@ -9445,7 +9445,8 @@ vshCmddefHelp(vshControl *ctl, const char *cmdname) else if (opt->type == VSH_OT_STRING) snprintf(buf, sizeof(buf), _("--%s "), opt->name); else if (opt->type == VSH_OT_DATA) - snprintf(buf, sizeof(buf), "<%s>", opt->name); + snprintf(buf, sizeof(buf), _("[--%s] "), + opt->name); fprintf(stdout, " %-15s %s\n", buf, _(opt->help)); }