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:
26
hecl/extra/hecl_autocomplete.sh
Executable file
26
hecl/extra/hecl_autocomplete.sh
Executable 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
|
||||
|
||||
Reference in New Issue
Block a user