Bugfix: depri first checks validity of item argument syntax before searching for todo.
Added testcase for the basic depriority command.
This commit is contained in:
2
todo.sh
2
todo.sh
@@ -745,9 +745,9 @@ case $action in
|
||||
item=$2
|
||||
errmsg="usage: $TODO_SH depri ITEM#"
|
||||
|
||||
[[ "$item" = +([0-9]) ]] || die "$errmsg"
|
||||
todo=$(sed "$item!d" "$TODO_FILE")
|
||||
[ -z "$todo" ] && die "$item: No such todo."
|
||||
[[ "$item" = +([0-9]) ]] || die "$errmsg"
|
||||
|
||||
sed -e $item"s/^(.) //" "$TODO_FILE" > /dev/null 2>&1
|
||||
|
||||
|
||||
Reference in New Issue
Block a user