Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Merge pull request #87 from inkarkat/complete-bash31-fix

FIX: todo_completion problem with Bash 3.1
  • Loading branch information...
commit 322c6b95d6b7ef0d14bb07793dfe92406684368e 2 parents 28e8a4c + d2c44e9
@ginatrapani authored
Showing with 3 additions and 2 deletions.
  1. +3 −2 todo_completion
View
5 todo_completion
@@ -14,14 +14,15 @@ _todo()
rm depri dp do help list ls listaddons listall lsa listcon \
lsc listfile lf listpri lsp listproj lsprj move \
mv prepend prep pri p replace report shorthelp"
+ local -r MOVE_COMMAND_PATTERN='^(move|mv)$'
local _todo_sh=${_todo_sh:-todo.sh}
local completions
if [ $COMP_CWORD -eq 1 ]; then
completions="$COMMANDS $(eval TODOTXT_VERBOSE=0 $_todo_sh command listaddons) $OPTS"
elif [[ $COMP_CWORD -gt 2 && ( \
- "${COMP_WORDS[COMP_CWORD-2]}" =~ ^(move|mv)$ || \
- "${COMP_WORDS[COMP_CWORD-3]}" =~ ^(move|mv)$ ) ]]; then
+ "${COMP_WORDS[COMP_CWORD-2]}" =~ $MOVE_COMMAND_PATTERN || \
+ "${COMP_WORDS[COMP_CWORD-3]}" =~ $MOVE_COMMAND_PATTERN ) ]]; then
# "move ITEM# DEST [SRC]" has file arguments on positions 2 and 3.
completions=$(eval TODOTXT_VERBOSE=0 $_todo_sh command listfile)
else
Please sign in to comment.
Something went wrong with that request. Please try again.