diff options
author | gramanas <anastasis.gramm2@gmail.com> | 2018-10-09 20:53:30 +0300 |
---|---|---|
committer | gramanas <anastasis.gramm2@gmail.com> | 2018-10-09 20:53:30 +0300 |
commit | 598e0522de924a50ea9c640955daab8512029eb4 (patch) | |
tree | 3f3cf027349a414e2f24d1a4c7976916e8b7dc21 /src/actionhelper.c | |
parent | fe781e5ae7116733e5b335a0ac016af97266db5f (diff) | |
download | ck-598e0522de924a50ea9c640955daab8512029eb4.tar.gz ck-598e0522de924a50ea9c640955daab8512029eb4.tar.bz2 ck-598e0522de924a50ea9c640955daab8512029eb4.zip |
Better list
Diffstat (limited to 'src/actionhelper.c')
-rw-r--r-- | src/actionhelper.c | 21 |
1 files changed, 15 insertions, 6 deletions
diff --git a/src/actionhelper.c b/src/actionhelper.c index 3e898af..582333e 100644 --- a/src/actionhelper.c +++ b/src/actionhelper.c @@ -149,15 +149,12 @@ void add_make_link(const AddOpt *opt, const Conf *conf) { } } -int edit_make_options(cklist *args) { - UNUSED(args); -} - ListOpt list_make_options(cklist *args) { list_rewind(args); ListOpt listOpt = { ._lt = LT_NONE, ._lst = LST_PLAIN, + .pName = NULL, .attr = 0, .err = 0 }; @@ -195,8 +192,21 @@ ListOpt list_make_options(cklist *args) { else if (strcmp(list_get(args), "tree") == 0) { listOpt._lt = LT_TREE; } + else if (strcmp(list_get(args), "ckconf") == 0) { + listOpt._lt = LT_CKCONF; + } + else if (strcmp(list_get(args), "-p") == 0) { + if (list_next(args)) { + listOpt._lt = LT_PROG_CONFS; + listOpt.pName = list_get(args); + } + else { + listOpt.err = 1; + break; + } + } else { - listOpt.err = 1; + listOpt.err = 1; } } while(list_next(args)); } @@ -240,7 +250,6 @@ void print_LIST_result(int err) { if (!err) { return; } - ERR("Wrong list arguments"); } void print_SEARCH_result(int err) { |