You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
40 lines
806 B
40 lines
806 B
12 years ago
|
# Easy Engine Auto Complete Feature
|
||
|
|
||
|
|
||
|
|
||
|
EEAUTO()
|
||
|
{
|
||
|
# Get Current Word
|
||
|
local CURRENT=${COMP_WORDS[COMP_CWORD]}
|
||
|
|
||
|
# List Of Suggested Words
|
||
|
COMPREPLY=( $(compgen -W "system site" -- $CURRENT) )
|
||
|
|
||
|
# Get Previous Word
|
||
|
local PREVIOUS=${COMP_WORDS[COMP_CWORD-1]}
|
||
|
|
||
|
# List Of Suggested Words
|
||
|
case "$PREVIOUS" in
|
||
|
system)
|
||
|
COMPREPLY=( $( compgen -W "install remove purge" -- $CURRENT ) )
|
||
|
return 0
|
||
|
;;
|
||
|
|
||
|
install|remove|purge)
|
||
|
COMPREPLY=( $( compgen -W "nginx php mysql pma postfix --all" -- $CURRENT ) )
|
||
|
return 0
|
||
|
;;
|
||
|
|
||
|
nginx|php|mysql|pma|postfix|--all)
|
||
|
COMPREPLY=( $( compgen -W "" -- $CURRENT ) )
|
||
|
return 0
|
||
|
;;
|
||
|
|
||
12 years ago
|
site)
|
||
12 years ago
|
COMPREPLY=( $( compgen -W "info list show create enable disable update delete backup" -- $CURRENT ) )
|
||
12 years ago
|
return 0
|
||
|
;;
|
||
|
esac
|
||
12 years ago
|
}
|
||
|
|
||
|
complete -F EEAUTO ee easyengine
|