From a0db476bed7d7b814c426d23b55a74d585a6d8cb Mon Sep 17 00:00:00 2001 From: Anastasis Grammenos Date: Fri, 5 Oct 2018 18:16:16 +0300 Subject: errlog in actionparser and configparser --- src/ck.c | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) (limited to 'src/ck.c') 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*/ -- cgit v1.2.3