diff options
author | Brian Cully <bjc@kublai.com> | 2022-03-09 21:10:26 -0500 |
---|---|---|
committer | Brian Cully <bjc@kublai.com> | 2022-03-09 21:37:48 -0500 |
commit | 720864f2a76d4ee3ed75cb99298b8e94c01f1b29 (patch) | |
tree | 7a163efe3d699725a9e9dd2c17aebaa6a6feadc7 /getconf.c | |
download | ticra-720864f2a76d4ee3ed75cb99298b8e94c01f1b29.tar.gz ticra-720864f2a76d4ee3ed75cb99298b8e94c01f1b29.zip |
I used to really hate AMANDA.
Diffstat (limited to 'getconf.c')
-rw-r--r-- | getconf.c | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/getconf.c b/getconf.c new file mode 100644 index 0000000..69f6b69 --- /dev/null +++ b/getconf.c @@ -0,0 +1,38 @@ +#include "config.h" +#include "conf.h" + +#include <stdio.h> + +RCSID("$Id: getconf.c,v 1.1.1.1 1999/02/02 23:29:39 shmit Exp $"); + +int +main(int argc, char *argv[]) +{ + if (read_config(SERVER_CONFIG_FILE) == -1) + return 1; + + while (--argc) { + const config_t *option; + + option = findopt(argv[argc]); + if (!option) + fprintf(stderr, + "Error: option `%s' doesn't exist or" + " is not set.\n", argv[argc]); + else + switch (option->type) { + case NUMOPT: + printf("%ld\n", option->numvalue); + break; + case STROPT: + printf("%s\n", option->strvalue); + break; + default: + fprintf(stderr, + "Error: don't understand option type" + " (this shouldn't happen).\n"); + } + } + + return 0; +} |