From 021f74591d5a99287443517c618c1ed514334986 Mon Sep 17 00:00:00 2001 From: gramanas Date: Thu, 20 Sep 2018 20:09:08 +0300 Subject: Add list tree support --- src/actions.c | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'src/actions.c') diff --git a/src/actions.c b/src/actions.c index 7d5276a..c084e8f 100644 --- a/src/actions.c +++ b/src/actions.c @@ -199,6 +199,9 @@ ListOpt make_list_options(cklist *args) { else if (strcmp(list_get(args), "programs") == 0) { listOpt._lt = LT_PROGRAM; } + else if (strcmp(list_get(args), "tree") == 0) { + listOpt._lt = LT_TREE; + } else { listOpt.err = 1; } @@ -209,6 +212,7 @@ ListOpt make_list_options(cklist *args) { } int run_LIST(UserOpt *opt, Conf *conf) { + UNUSED(conf); DB db = open_DB(opt); if (db.ptr == NULL) { if (db.error == SQL_ERR_NO_TABLES) { @@ -232,6 +236,12 @@ int run_LIST(UserOpt *opt, Conf *conf) { case LT_PROGRAM: list_get_programs(&db, list_type); break; + case LT_TREE: + list_get_path_program_tree(&db, list_type); + list_print(list_type); + close_DB(&db); + list_free(list_type); + return 1; case LT_NONE: printf("What should I list? (paths, configs)\n"); close_DB(&db); -- cgit v1.2.3