aboutsummaryrefslogtreecommitdiffstats
path: root/src/ck.c
diff options
context:
space:
mode:
authorAnastasis Grammenos <anastasis.gramm2@gmail.com>2018-10-05 18:16:16 +0300
committerAnastasis Grammenos <anastasis.gramm2@gmail.com>2018-10-05 19:36:11 +0300
commita0db476bed7d7b814c426d23b55a74d585a6d8cb (patch)
treeffde1fae7d75701e7dba31cf53077a9ca21b3a53 /src/ck.c
parent764a205fe9676afcdb94998b5e553d650bda86ba (diff)
downloadck-a0db476bed7d7b814c426d23b55a74d585a6d8cb.tar.gz
ck-a0db476bed7d7b814c426d23b55a74d585a6d8cb.tar.bz2
ck-a0db476bed7d7b814c426d23b55a74d585a6d8cb.zip
errlog in actionparser and configparser
Diffstat (limited to 'src/ck.c')
-rw-r--r--src/ck.c15
1 files changed, 5 insertions, 10 deletions
diff --git a/src/ck.c b/src/ck.c
index 4a0a626..f9a2ad1 100644
--- a/src/ck.c
+++ b/src/ck.c
@@ -35,21 +35,16 @@
#include "ckerrlog.h"
int main(int argc, char *argv[]) {
- initialize_errlog();
+ initialize_errlog(argc, argv);
UserOpt opt;
Conf conf = {.vc_dir = NULL, .scrt_dir = NULL};
/* get user opt */
- switch(parse_action(argc, argv, &opt)) {
- case APR_HELP:
- print_parser_help();
+ int rc = parse_action(argc, argv, &opt);
+ if (rc < 0) {
goto error;
- case APR_ERR:
- print_parser_error(&opt);
- goto error;
- case APR_VERSION:
+ }
+ else if (rc == 1) {
goto close;
- case APR_OK:
- break;
}
/* If the action is init don't load the config, skip to running init*/