From c91cddb6f714f4128d8a192cab1f42b00efe3672 Mon Sep 17 00:00:00 2001 From: Erik Skultety Date: Fri, 16 Sep 2016 14:32:01 +0200 Subject: [PATCH] vsh: vshCmddefHelp: Drop unnecessary variable 'help' 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 --- tools/vsh.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/tools/vsh.c b/tools/vsh.c index f3b3fca61a..cc42152435 100644 --- a/tools/vsh.c +++ b/tools/vsh.c @@ -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)