From cd7d2f2fda96bb6733c5c43e4b69cd11c26f76c1 Mon Sep 17 00:00:00 2001 From: Ingo Karkat Date: Sun, 20 Nov 2011 17:07:59 +0100 Subject: [PATCH] ENH: Add file completion for move. --- todo_completion | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/todo_completion b/todo_completion index 7e6bbe6..7f3d391 100644 --- a/todo_completion +++ b/todo_completion @@ -22,6 +22,11 @@ _todo() local completions if [ $COMP_CWORD -eq 1 ]; then 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 case "$prev" in command)