diff options
author | David Sommerseth <dazo@users.sourceforge.net> | 2008-12-04 22:52:45 +0100 |
---|---|---|
committer | David Sommerseth <dazo@users.sourceforge.net> | 2008-12-04 22:52:45 +0100 |
commit | 46057a46c1d920e456179b6c8ef51c9347b0dbaf (patch) | |
tree | ad7ffda96f7935d87766b2fe9581dc93dc24ff8a /eurephiadm | |
parent | 6643e6a35d046173fa75e3f557f96b2f1a6772b6 (diff) | |
download | eurephia-46057a46c1d920e456179b6c8ef51c9347b0dbaf.tar.gz eurephia-46057a46c1d920e456179b6c8ef51c9347b0dbaf.tar.xz eurephia-46057a46c1d920e456179b6c8ef51c9347b0dbaf.zip |
Fixed the missing 'help' page when doing 'help help' or '-h help'
Diffstat (limited to 'eurephiadm')
-rw-r--r-- | eurephiadm/commands.h | 3 | ||||
-rw-r--r-- | eurephiadm/eurephiadm.c | 8 |
2 files changed, 9 insertions, 2 deletions
diff --git a/eurephiadm/commands.h b/eurephiadm/commands.h index 6f8a0ae..6f2c7dc 100644 --- a/eurephiadm/commands.h +++ b/eurephiadm/commands.h @@ -35,6 +35,7 @@ typedef struct { } eurephiadm_functions; /* eurephiadm commands, found in eurephiadm.c */ +void help_Help(); int cmd_Help(eurephiaCTX *, eurephiaSESSION *, eurephiaVALUES *cfg, int argc, char **argv); int cmd_Logout(eurephiaCTX *, eurephiaSESSION *, eurephiaVALUES *cfg, int argc, char **argv); int cmd_ShowCfg(eurephiaCTX *, eurephiaSESSION *, eurephiaVALUES *cfg, int argc, char **argv); @@ -53,7 +54,7 @@ static const eurephiadm_functions cmdline_functions[] = { // helpinfo, helpdescr, function} {"help", 0, NULL, "[<command>]", - "This help screen", NULL, cmd_Help}, + "This help screen", help_Help, cmd_Help}, {"logout", 1, NULL, NULL, // Logout is specially handled - change with care "Logout from an open session", NULL, cmd_Logout}, diff --git a/eurephiadm/eurephiadm.c b/eurephiadm/eurephiadm.c index 7375b21..9e3bfba 100644 --- a/eurephiadm/eurephiadm.c +++ b/eurephiadm/eurephiadm.c @@ -52,6 +52,12 @@ char *print_version(char *fprg) { } +void help_Help() { + char *argv[] = { MODULE, NULL }; + + cmd_Help(NULL, NULL, NULL, 1, argv); +} + int cmd_Help(eurephiaCTX *ctx, eurephiaSESSION *sess, eurephiaVALUES *cfg, int argc, char **argv) { eurephiadm_functions *func = NULL; int i; @@ -73,7 +79,7 @@ int cmd_Help(eurephiaCTX *ctx, eurephiaSESSION *sess, eurephiaVALUES *cfg, int a return 1; } - prg = print_version(argv[0]); + prg = print_version((strcmp(argv[0], "help") == 0) ? MODULE : argv[0]); fprintf(stdout, "\n Usage: %s [global options] <command> [command options]\n\n", prg); |