2
0
mirror of https://github.com/AxioDL/metaforce.git synced 2025-12-08 13:04:56 +00:00

added a shiny bash-autocomplete script

This commit is contained in:
Jack Andersen
2015-05-19 11:01:32 -10:00
parent d10c3a831d
commit 66d07af26e
12 changed files with 64 additions and 30 deletions

26
hecl/extra/hecl_autocomplete.sh Executable file
View File

@@ -0,0 +1,26 @@
#!/bin/bash
_hecl ()
{
local word=${COMP_WORDS[COMP_CWORD]}
local filecmds=(init add group cook clean package)
if [ $COMP_CWORD == 1 ]
then
COMPREPLY=($(compgen -W "${filecmds[*]} help" "${word}"))
return 0
elif [ $COMP_CWORD == 2 ]
then
case ${COMP_WORDS[1]} in
init|add|group|cook|clean|package)
COMPREPLY=($(compgen -f -- "${word}"))
;;
help)
COMPREPLY=($(compgen -W "${filecmds[*]}" "${word}"))
;;
esac
fi
}
complete -F _hecl hecl