aboutsummaryrefslogtreecommitdiffstats
path: root/src/actionparser.c
diff options
context:
space:
mode:
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) {