Skip to content
This repository
  • 2 commits
  • 1 file changed
  • 0 comments
  • 2 contributors
Apr 25, 2012
FIX: todo_completion problem with Bash 3.1
Regexp matching changed from 3.1 to 3.2. Make it work for Bash 3.1 by using an intermediate variable, as in 394c4c7.
Cp. http://tech.groups.yahoo.com/group/todotxt/message/4211
d2c44e9
May 10, 2012
Gina Trapani Merge pull request #87 from inkarkat/complete-bash31-fix
FIX: todo_completion problem with Bash 3.1
322c6b9

Showing 1 changed file with 3 additions and 2 deletions. Show diff stats Hide diff stats

  1. 5  todo_completion
5  todo_completion
@@ -14,14 +14,15 @@ _todo()
14 14
         rm depri dp do help list ls listaddons listall lsa listcon  \
15 15
         lsc listfile lf listpri lsp listproj lsprj move \
16 16
         mv prepend prep pri p replace report shorthelp"
  17
+    local -r MOVE_COMMAND_PATTERN='^(move|mv)$'
17 18
 
18 19
     local _todo_sh=${_todo_sh:-todo.sh}
19 20
     local completions
20 21
     if [ $COMP_CWORD -eq 1 ]; then
21 22
         completions="$COMMANDS $(eval TODOTXT_VERBOSE=0 $_todo_sh command listaddons) $OPTS"
22 23
     elif [[ $COMP_CWORD -gt 2 && ( \
23  
-        "${COMP_WORDS[COMP_CWORD-2]}" =~ ^(move|mv)$ || \
24  
-        "${COMP_WORDS[COMP_CWORD-3]}" =~ ^(move|mv)$ ) ]]; then
  24
+        "${COMP_WORDS[COMP_CWORD-2]}" =~ $MOVE_COMMAND_PATTERN || \
  25
+        "${COMP_WORDS[COMP_CWORD-3]}" =~ $MOVE_COMMAND_PATTERN ) ]]; then
25 26
         # "move ITEM# DEST [SRC]" has file arguments on positions 2 and 3.
26 27
         completions=$(eval TODOTXT_VERBOSE=0 $_todo_sh command listfile)
27 28
     else

No commit comments for this range

Something went wrong with that request. Please try again.