From 147efc35461763c38e8875afac7bc44d2559204b Mon Sep 17 00:00:00 2001 From: gramanas Date: Thu, 18 Oct 2018 16:30:47 +0300 Subject: Fix bug where help would not run if ck was not initialized --- src/ck.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/ck.c b/src/ck.c index 8aeb6d1..96ddeae 100644 --- a/src/ck.c +++ b/src/ck.c @@ -44,12 +44,13 @@ int main(int argc, char *argv[]) { if (parse_action(argc, argv, &opt)) { goto error; } - /* If the action is init don't load the config, skip to running init*/ - if (opt.action != CKA_INIT) { + /* If the action is init or help don't load the config, skip to running it*/ + if (opt.action != CKA_INIT && + opt.action != CKA_HELP) { /* If the db doesn't exist ck is not initialized in the config * location specified in opt */ if (!db_exists(&opt)) { - ERR("ck is not initialized in %s.\nRun ck init first.\n", opt.confDir); + ERR("ck is not initialized in %s.\nRun ck init first.", opt.confDir); goto error; } /* Finally parse the config file and exit on error */ -- cgit v1.2.3