]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
vsh: vshCmddefHelp: Drop unnecessary variable 'help'
authorErik Skultety <eskultet@redhat.com>
Fri, 16 Sep 2016 12:32:01 +0000 (14:32 +0200)
committerErik Skultety <eskultet@redhat.com>
Tue, 20 Sep 2016 13:05:31 +0000 (15:05 +0200)
Since it's used on a single place only, it can easily be replaced by the right
side of the original assignment.

Signed-off-by: Erik Skultety <eskultet@redhat.com>
tools/vsh.c

index f3b3fca61ad2ef84411a81fded11160424f0d984..cc42152435067af98f5903b096e04978b01cfce5 100644 (file)
@@ -636,7 +636,6 @@ vshCmddefHelp(vshControl *ctl, const char *cmdname)
     } else {
         /* Don't translate desc if it is "".  */
         const char *desc = vshCmddefGetInfo(def, "desc");
-        const char *help = _(vshCmddefGetInfo(def, "help"));
         char buf[256];
         uint64_t opts_need_arg;
         uint64_t opts_required;
@@ -649,7 +648,8 @@ vshCmddefHelp(vshControl *ctl, const char *cmdname)
         }
 
         fputs(_("  NAME\n"), stdout);
-        fprintf(stdout, "    %s - %s\n", def->name, help);
+        fprintf(stdout, "    %s - %s\n", def->name,
+                _(vshCmddefGetInfo(def, "help")));
 
         fputs(_("\n  SYNOPSIS\n"), stdout);
         fprintf(stdout, "    %s", def->name);
@@ -3357,8 +3357,6 @@ cmdSelfTest(vshControl *ctl, const vshCmd *cmd ATTRIBUTE_UNUSED)
     const vshCmdGrp *grp;
     const vshCmdDef *def;
 
-    vshPrint(ctl, "Do not use the following output:\n\n");
-
     for (grp = cmdGroups; grp->name; grp++) {
         for (def = grp->commands; def->name; def++) {
             if (def->flags & VSH_CMD_FLAG_ALIAS)