[libvirt] [PATCH] virsh: Remove redundant optional option for cmdHelp

Osier Yang jyang at redhat.com
Fri Dec 3 07:34:23 UTC 2010


Remove the optional option "group", as cmdHelp should accepts
only one option, and rename option "command" as "command-or-group",
("virsh help" supports both command and command group now, and user
nealy uses the options, so it doesn't matter much for it being longer,
:-)

* tools/virsh.c
---
 tools/virsh.c |    8 ++------
 1 files changed, 2 insertions(+), 6 deletions(-)

diff --git a/tools/virsh.c b/tools/virsh.c
index 31de80f..c2d717f 100644
--- a/tools/virsh.c
+++ b/tools/virsh.c
@@ -569,8 +569,7 @@ static const vshCmdInfo info_help[] = {
 };

 static const vshCmdOptDef opts_help[] = {
-    {"command", VSH_OT_DATA, 0, N_("Prints global help or command specific help.")},
-    {"group", VSH_OT_DATA, 0, N_("Prints global help or help for a group of related commands.")},
+    {"command-or-group", VSH_OT_DATA, 0, N_("Prints global help, command specific help, or help for a group of related commands")},
     {NULL, 0, 0, NULL}
 };

@@ -581,10 +580,7 @@ cmdHelp(vshControl *ctl, const vshCmd *cmd)
     const vshCmdGrp *g;
     const char *name;

-    name = vshCommandOptString(cmd, "command", NULL);
-
-    if (!name)
-        name = vshCommandOptString(cmd, "group", NULL);
+    name = vshCommandOptString(cmd, "command-or-group", NULL);

     if (!name) {
         const vshCmdGrp *grp;
--
1.7.3.2




More information about the libvir-list mailing list