From: short <> Date: Tue, 28 Oct 2003 14:02:56 +0000 (+0000) Subject: Support 'help command_name' as the equivalent of 'command_name --help'. X-Git-Tag: captive-1_0_1~19 X-Git-Url: http://git.jankratochvil.net/?p=captive.git;a=commitdiff_plain;h=1e0e6b861cf311dffb397a308fbb0a86f389ed61;hp=8d5dddfae199a24da21b8566364bc19e0351991f Support 'help command_name' as the equivalent of 'command_name --help'. --- diff --git a/src/client/cmdline/cmd_help.c b/src/client/cmdline/cmd_help.c index 92b57d4..ada33cb 100644 --- a/src/client/cmdline/cmd_help.c +++ b/src/client/cmdline/cmd_help.c @@ -54,6 +54,16 @@ int cmd_name_maxlen; g_return_if_fail(!errp || !*errp); + if (cmd_argv[0]) { +const char *cmd_help_argv[3]; + + cmd_help_argv[0]=cmd_argv[0]; + cmd_help_argv[1]="--help"; + cmd_help_argv[2]=NULL; + invoke_cmd(2,cmd_help_argv); + return; + } + cmd_name_maxlen=0; for (commandp=cmdline_command_table+1;commandp->name;commandp++) cmd_name_maxlen=MAX(cmd_name_maxlen,(int)strlen(commandp->name));