]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
print syntax if we're getting help for one specific command
authorAlan T. DeKok <aland@freeradius.org>
Thu, 26 Jul 2018 16:23:48 +0000 (12:23 -0400)
committerAlan T. DeKok <aland@freeradius.org>
Thu, 26 Jul 2018 16:26:28 +0000 (12:26 -0400)
src/lib/server/command.c

index 46aeb929c8b8a20e59e57e65840d900760640914..d08e9929a35030ca035afe5d435075d4f3349348 100644 (file)
@@ -2624,8 +2624,15 @@ int fr_command_print_help(FILE *fp, fr_cmd_t *head, char const *text)
                return 0;
        }
 
-       print_help(fp, cmd);
-
+       /*
+        *      For one command, try to print out the syntax, as it's
+        *      generally more useful than the help.
+        */
+       if (!cmd->syntax) {
+               print_help(fp, cmd);
+       } else {
+               fprintf(fp, "%-30s%s\n", cmd->name, cmd->syntax);
+       }
        return 0;
 }