Minor improvement to bash autocompletion

This commit is contained in:
Pablo Hoffman 2010-08-22 20:10:11 -03:00
parent fd784cd131
commit cf8a085f44
1 changed files with 4 additions and 2 deletions

View File

@ -10,8 +10,10 @@ _scrapy_completion() {
COMPREPLY=(${COMPREPLY[@]:-} $(compgen -W "$spiders" -- "$cur"))
;;
*)
commands="crawl fetch genspider list parse queue runserver runspider settings shell startproject view"
COMPREPLY=(${COMPREPLY[@]:-} $(compgen -W "$commands" -- "$cmd"))
if [ $COMP_CWORD -eq 1 ]; then
commands="crawl fetch genspider list parse queue runserver runspider settings shell startproject view"
COMPREPLY=(${COMPREPLY[@]:-} $(compgen -W "$commands" -- "$cmd"))
fi
;;
esac
}