ENH: Add file completion for move.

This commit is contained in:
Ingo Karkat
2011-11-20 17:07:59 +01:00
parent 395465b5f2
commit cd7d2f2fda

View File

@@ -22,6 +22,11 @@ _todo()
local completions local completions
if [ $COMP_CWORD -eq 1 ]; then if [ $COMP_CWORD -eq 1 ]; then
completions="$allCommands $OPTS" completions="$allCommands $OPTS"
elif [[ $COMP_CWORD -gt 2 && ( \
"${COMP_WORDS[COMP_CWORD-2]}" =~ ^(move|mv)$ || \
"${COMP_WORDS[COMP_CWORD-3]}" =~ ^(move|mv)$ ) ]]; then
# "move ITEM# DEST [SRC]" has file arguments on positions 2 and 3.
completions=$(TODOTXT_VERBOSE=0 todo.sh command listfile)
else else
case "$prev" in case "$prev" in
command) command)