Skip to content

Commit

Permalink
use consistent quoting for $# with rest of file
Browse files Browse the repository at this point in the history
$# will always be an integer and never needs quoting
  • Loading branch information
a1346054 committed Aug 12, 2021
1 parent 17723d5 commit cc73bd4
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions todo.sh
Original file line number Diff line number Diff line change
Expand Up @@ -1212,7 +1212,7 @@ case $action in
errmsg="usage: $TODO_SH do ITEM#[, ITEM#, ITEM#, ...]"
# shift so we get arguments to the do request
shift;
[ "$#" -eq 0 ] && die "$errmsg"
[ $# -eq 0 ] && die "$errmsg"

# Split multiple do's, if comma separated change to whitespace separated
# Loop the 'do' function for each item
Expand Down Expand Up @@ -1366,14 +1366,14 @@ case $action in

"pri" | "p")
shift
while [ "$#" -gt 0 ]; do
while [ $# -gt 0 ]; do
item=$1
newpri=$(printf "%s\n" "$2" | tr '[:lower:]' '[:upper:]')

errmsg="usage: $TODO_SH pri ITEM# PRIORITY[, ITEM# PRIORITY, ...]
note: PRIORITY must be anywhere from A to Z."

[ "$#" -lt 2 ] && die "$errmsg"
[ $# -lt 2 ] && die "$errmsg"
[[ "$newpri" = @([A-Z]) ]] || die "$errmsg"
getTodo "$item"

Expand Down

0 comments on commit cc73bd4

Please sign in to comment.