diff options
author | gramanas <anastasis.gramm2@gmail.com> | 2018-10-12 16:50:47 +0300 |
---|---|---|
committer | gramanas <anastasis.gramm2@gmail.com> | 2018-10-12 16:50:47 +0300 |
commit | 673627581f42bb32f20a356dd190a0abd38d1962 (patch) | |
tree | 19fde5c35fc55ff0cf898cfba4146986583bd0cd /src/actions.c | |
parent | 14d030093e599b342acf0e0450bf29c6268d21d7 (diff) | |
download | ck-673627581f42bb32f20a356dd190a0abd38d1962.tar.gz ck-673627581f42bb32f20a356dd190a0abd38d1962.tar.bz2 ck-673627581f42bb32f20a356dd190a0abd38d1962.zip |
More errlog integration
Diffstat (limited to 'src/actions.c')
-rw-r--r-- | src/actions.c | 21 |
1 files changed, 4 insertions, 17 deletions
diff --git a/src/actions.c b/src/actions.c index 1b4c9b5..74b6338 100644 --- a/src/actions.c +++ b/src/actions.c @@ -75,7 +75,6 @@ int run_ADD(UserOpt * opt, Conf *conf) { } int run_DEL(UserOpt * opt, Conf *conf) { - printf("Running del\n"); DB db = open_DB(opt); if (db.ptr == NULL) { if (db.error == SQL_ERR_NO_TABLES) { @@ -91,10 +90,10 @@ int run_DEL(UserOpt * opt, Conf *conf) { close_DB(&db); return 0; case DEL_ERR_WRONG_ARGS: - printf("wrong del args\n"); + ERR("Wrong delete arguments."); break; case DEL_ERR_WRONG_PATH: - printf("path %s doesnt exist\n", delOpt.arg); + ERR("Path %s doesnt exist.", delOpt.arg); } error: close_DB(&db); @@ -134,13 +133,7 @@ int run_EDIT(UserOpt *opt, Conf *conf) { /* If the program has many configs */ else { HELP("Ambiguous config. Please type the config name after the program."); - char name[STR_M] = ""; - strcat(name, pName); - strcat(name, ":"); - cklist *paths = list_make_and_add(name); - get_program_paths(&db, paths, pName, 1, 0); - list_print(paths); - list_free(paths); + edit_print_suggested_configs(&db, pName); goto error; } } @@ -150,13 +143,7 @@ int run_EDIT(UserOpt *opt, Conf *conf) { char *cName = list_get(opt->args); if (edit_get_config(&db, pName, confName, cName, &secret)) { ERR("Program %s doesn't have a config named %s", pName, cName); - char name[STR_M] = ""; - strcat(name, pName); - strcat(name, ":"); - cklist *paths = list_make_and_add(name); - get_program_paths(&db, paths, pName, 1, 0); - list_print(paths); - list_free(paths); + edit_print_suggested_configs(&db, pName); goto error; } } |