From 36d02757fd6863a845163daf0d730bdcc0a28343 Mon Sep 17 00:00:00 2001 From: Hartmut Reuter Date: Mon, 12 Feb 2001 17:13:29 +0000 Subject: [PATCH] cmd-suite-option-for-hiding-admin-commands-20010212 Hide help for admin commands unless asked for --- src/cmd/cmd.c | 8 ++++++++ src/cmd/cmd.p.h | 1 + 2 files changed, 9 insertions(+) diff --git a/src/cmd/cmd.c b/src/cmd/cmd.c index f8d6d0bbe..253586972 100644 --- a/src/cmd/cmd.c +++ b/src/cmd/cmd.c @@ -398,6 +398,13 @@ char *aname; { return 0; /* all done */ } +int cmd_IsAdministratorCommand(as) +register struct cmd_syndesc *as; +{ + as->flags |= CMD_ADMIN; + return 0; +} + int cmd_Seek(as, apos) register struct cmd_syndesc *as; int apos; { @@ -594,6 +601,7 @@ char **argv; ts = cmd_CreateSyntax("help", HelpProc, (char*)0, "get help on commands"); cmd_AddParm(ts, "-topic", CMD_LIST, CMD_OPTIONAL, "help string"); + cmd_AddParm(ts, "-admin", CMD_FLAG, CMD_OPTIONAL, (char *)0); ts = cmd_CreateSyntax("apropos", AproposProc, (char*)0, "search by help text"); diff --git a/src/cmd/cmd.p.h b/src/cmd/cmd.p.h index ec69bb820..a4a77bff2 100644 --- a/src/cmd/cmd.p.h +++ b/src/cmd/cmd.p.h @@ -18,6 +18,7 @@ /* syndesc flags */ #define CMD_ALIAS 1 /* this is an alias */ +#define CMD_ADMIN 2 /* admin. command, show only with -admin */ #define CMD_HIDDEN 4 /* A hidden command - similar to CMD_HIDE */ #define CMD_HELPPARM (CMD_MAXPARMS-1)/* last one is used by -help switch */ -- 2.39.5