aboutsummaryrefslogtreecommitdiffstats
path: root/src/actionparser.c
diff options
context:
space:
mode:
authorgramanas <anastasis.gramm2@gmail.com>2018-09-27 16:54:43 +0300
committergramanas <anastasis.gramm2@gmail.com>2018-09-27 16:54:43 +0300
commit65986f9cd9429c7876e5d2f09e4a0cd19d966fa3 (patch)
treea77f12361571bd6c89ccd478db3dba2866719df3 /src/actionparser.c
parent03917439a1ddcf202e9fc53937b10eeb7ec0a99a (diff)
downloadck-65986f9cd9429c7876e5d2f09e4a0cd19d966fa3.tar.gz
ck-65986f9cd9429c7876e5d2f09e4a0cd19d966fa3.tar.bz2
ck-65986f9cd9429c7876e5d2f09e4a0cd19d966fa3.zip
Add dummy delete
Diffstat (limited to 'src/actionparser.c')
-rw-r--r--src/actionparser.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/actionparser.c b/src/actionparser.c
index 0057e7f..82ae25e 100644
--- a/src/actionparser.c
+++ b/src/actionparser.c
@@ -100,7 +100,15 @@ int parse_ADD(UserOpt *opt) {
}
int parse_DEL(UserOpt *opt) {
- return -1;
+ /* DEL expects 1 to 2 arguments */
+ if (optNum <= pos || optNum > pos + 2) {
+ opt->err = PERR_DEL_WRONG;
+ return -1;
+ }
+
+ int arg_num = optNum - pos;
+ fill_args_list(arg_num, opt);
+ return 1;
}
int parse_EDIT(UserOpt *opt) {