From: Alan T. DeKok Date: Sat, 28 Jul 2018 13:00:53 +0000 (-0400) Subject: we no longer need nested "help" X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=7a559fadac9b9da1fec3f42e509f373c0f6bf55a;p=thirdparty%2Ffreeradius-server.git we no longer need nested "help" now that we have '?' working --- diff --git a/src/bin/radmin.c b/src/bin/radmin.c index 91d0057f063..b54b391fdcc 100644 --- a/src/bin/radmin.c +++ b/src/bin/radmin.c @@ -140,7 +140,6 @@ static char *radmin_buffer = NULL; #define CMD_MAX_ARGV (32) #define CMD_MAX_EXPANSIONS (128) -static int cmd_help(FILE *fp, FILE *fp_err, void *ctx, fr_cmd_info_t const *info); static int cmd_exit(FILE *fp, FILE *fp_err, UNUSED void *ctx, fr_cmd_info_t const *info); #ifdef USE_READLINE @@ -269,16 +268,6 @@ static void *fr_radmin(UNUSED void *input_ctx) * Special-case commands in sub-contexts. */ if (context > 0) { - /* - * We're in a nested command and the user typed - * "help". Act as if they typed "help ...". - * It's just polite. - */ - if (strcmp(line, "help") == 0) { - cmd_help(stdout, stderr, &radmin_info, info); - goto next; - } - /* * Special-case "quit", which works everywhere. * It closes the CLI immediately. @@ -434,22 +423,6 @@ static int cmd_help(FILE *fp, UNUSED FILE *fp_err, void *ctx, fr_cmd_info_t cons int max = 1; fr_cmd_t *cmd = NULL; - /* - * We're called in a context from `radiusd -r`. Do magic. - */ - if (ctx == &radmin_info) { - int i; - - rad_assert(radmin_info.argc > 0); - - for (i = radmin_info.argc - 1; i >= 0; i--) { - if ((cmd = radmin_info.cmd[i]) != NULL) break; - } - - fr_command_list(fp, 1, cmd, FR_COMMAND_OPTION_LIST_CHILD); - return 0; - } - if ((info->argc > 0) && (strcmp(info->argv[0], "all") == 0)) { max = CMD_MAX_ARGV; }