diff options
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; } } |