cmd-print-help-in-cases-without-subcommands-20030203
authorMatt Bacchi <mbacchi@gmavt.net>
Mon, 3 Feb 2003 23:15:58 +0000 (23:15 +0000)
committerDerrick Brashear <shadow@dementia.org>
Mon, 3 Feb 2003 23:15:58 +0000 (23:15 +0000)
FIXES 1277

so libcmd supports help for e.g. pt_util

src/cmd/cmd.c

index 9419038..8cf2e21 100644 (file)
@@ -762,6 +762,9 @@ int cmd_Dispatch(int argc, char **argv)
        otherwise it is a real nuisance */
     if (ts->parms[CMD_HELPPARM].items) {
        PrintSyntax(ts);
+       /* Display full help syntax if we don't have subcommands */
+       if (noOpcodes)
+           PrintFlagHelp(ts);
        ResetSyntax(ts);
        return 0;
     }