aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorgramanas <anastasis.gramm2@gmail.com>2018-10-18 16:30:47 +0300
committergramanas <anastasis.gramm2@gmail.com>2018-10-18 16:30:47 +0300
commit147efc35461763c38e8875afac7bc44d2559204b (patch)
tree2a2ea0858c3af688f71df78b48901cbf273ce99e
parent505dd4d9170c1435777eb6fcd306d078056ea35e (diff)
downloadck-147efc35461763c38e8875afac7bc44d2559204b.tar.gz
ck-147efc35461763c38e8875afac7bc44d2559204b.tar.bz2
ck-147efc35461763c38e8875afac7bc44d2559204b.zip
Fix bug where help would not run if ck was not initialized
-rw-r--r--src/ck.c7
1 files 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 */