From: Alan T. DeKok Date: Thu, 26 Jul 2018 16:23:48 +0000 (-0400) Subject: print syntax if we're getting help for one specific command X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=288feb9c83aefeb2495a3bed45e70d8ce5889bd9;p=thirdparty%2Ffreeradius-server.git print syntax if we're getting help for one specific command --- diff --git a/src/lib/server/command.c b/src/lib/server/command.c index 46aeb929c8b..d08e9929a35 100644 --- a/src/lib/server/command.c +++ b/src/lib/server/command.c @@ -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; }