From 394dcf65ecb5fcd5ba6cb4e27f6f636355e3e5e8 Mon Sep 17 00:00:00 2001 From: Danny Auble <da@llnl.gov> Date: Fri, 25 Jul 2008 18:34:39 +0000 Subject: [PATCH] removal of all and hide options from sacctmgr --- doc/man/man1/sacctmgr.1 | 18 ------------------ src/sacctmgr/sacctmgr.c | 26 +------------------------- 2 files changed, 1 insertion(+), 43 deletions(-) diff --git a/doc/man/man1/sacctmgr.1 b/doc/man/man1/sacctmgr.1 index 01dad39b3c0..383728ed253 100644 --- a/doc/man/man1/sacctmgr.1 +++ b/doc/man/man1/sacctmgr.1 @@ -25,21 +25,11 @@ add, delete, modify, and/or list \fIassociation\fR records then commit the changes and exit. .SH "OPTIONS" -.TP -\fB\-a\fR, \fB\-\-all\fR -Display information about all entities including hidden or deleted ones. -This is equivalent to the \fBall\fR command. - .TP \fB\-h\fR, \fB\-\-help\fR Print a help message describing the usage of \fBssacctmgr\fR. This is equivalent to the \fBhelp\fR command. -.TP -\fB\-\-hide\fR -Do not display information about hidden or deleted entities. -This is equivalent to the \fBhide\fR command. - .TP \fB\-\-immediate\fR commit changes immediately. @@ -79,10 +69,6 @@ This is equivalent to the \fBversion\fR command. .SH "COMMANDS" -.TP -\fBall\fR -Display information about all entities including hidden or deleted ones. - .TP \fBadd\fR <\fIENTITY\fR> <\fISPECS\fR> Add an entity. @@ -110,10 +96,6 @@ Identical to the \fBquit\fR command. \fBhelp\fP Display a description of sacctmgr options and commands. -.TP -\fBhide\fP -Do not display information about hidden or deleted entities. - .TP \fBlist\fR <\fIENTITY\fR> [with <\fISPECS\fR>] Display information about the specified entities. diff --git a/src/sacctmgr/sacctmgr.c b/src/sacctmgr/sacctmgr.c index fe53cf9a06f..8bb49aeb835 100644 --- a/src/sacctmgr/sacctmgr.c +++ b/src/sacctmgr/sacctmgr.c @@ -41,11 +41,9 @@ #include "src/sacctmgr/sacctmgr.h" #include "src/common/xsignal.h" -#define OPT_LONG_HIDE 0x102 #define BUFFER_SIZE 4096 char *command_name; -int all_flag; /* display even hidden partitions */ int exit_code; /* sacctmgr's exit code, =1 on any error at any time */ int exit_flag; /* program to terminate if =1 */ int input_words; /* number of words of input permitted */ @@ -76,9 +74,7 @@ main (int argc, char *argv[]) int option_index; static struct option long_options[] = { - {"all", 0, 0, 'a'}, {"help", 0, 0, 'h'}, - {"hide", 0, 0, OPT_LONG_HIDE}, {"immediate",0, 0, 'i'}, {"oneliner", 0, 0, 'o'}, {"no_header", 0, 0, 'n'}, @@ -92,7 +88,6 @@ main (int argc, char *argv[]) }; command_name = argv[0]; - all_flag = 0; rollback_flag = 1; exit_code = 0; exit_flag = 0; @@ -101,10 +96,7 @@ main (int argc, char *argv[]) verbosity = 0; log_init("sacctmgr", opts, SYSLOG_FACILITY_DAEMON, NULL); - if (getenv ("SACCTMGR_ALL")) - all_flag= 1; - - while((opt_char = getopt_long(argc, argv, "ahionpqsvV", + while((opt_char = getopt_long(argc, argv, "hionpqsvV", long_options, &option_index)) != -1) { switch (opt_char) { case (int)'?': @@ -112,16 +104,10 @@ main (int argc, char *argv[]) "for more information\n"); exit(1); break; - case (int)'a': - all_flag = 1; - break; case (int)'h': _usage (); exit(exit_code); break; - case OPT_LONG_HIDE: - all_flag = 0; - break; case (int)'i': rollback_flag = 0; break; @@ -325,8 +311,6 @@ _process_command (int argc, char *argv[]) exit_code = 1; if (quiet_flag == -1) fprintf(stderr, "no input"); - } else if (strncasecmp (argv[0], "all", 3) == 0) { - all_flag = 1; } else if (strncasecmp (argv[0], "associations", 3) == 0) { with_assoc_flag = 1; } else if (strncasecmp (argv[0], "dump", 3) == 0) { @@ -346,8 +330,6 @@ _process_command (int argc, char *argv[]) argv[0]); } _usage (); - } else if (strncasecmp (argv[0], "hide", 2) == 0) { - all_flag = 0; } else if (strncasecmp (argv[0], "load", 2) == 0) { if (argc < 2) { exit_code = 1; @@ -601,9 +583,7 @@ void _usage () { printf ("\ sacctmgr [<OPTION>] [<COMMAND>] \n\ Valid <OPTION> values are: \n\ - -a or --all: equivalent to \"all\" command \n\ -h or --help: equivalent to \"help\" command \n\ - --hide: equivalent to \"hide\" command \n\ -i or --immediate: commit changes immediately \n\ -n or --no_header: no header will be added to the beginning of output \n\ -o or --oneliner: equivalent to \"oneliner\" command \n\ @@ -618,16 +598,12 @@ sacctmgr [<OPTION>] [<COMMAND>] \n\ terminated. \n\ \n\ Valid <COMMAND> values are: \n\ - all display information about all entities, \n\ - including hidden/deleted ones. \n\ add <ENTITY> <SPECS> add entity \n\ associations when using show/list will list the \n\ associations associated with the entity. \n\ delete <ENTITY> <SPECS> delete the specified entity(s) \n\ exit terminate sacctmgr \n\ help print this description of use. \n\ - hide do not display information about \n\ - hidden/deleted entities. \n\ list <ENTITY> [<SPECS>] display info of identified entity, default \n\ is display all. \n\ modify <ENTITY> <SPECS> modify entity \n\ -- GitLab