Rev | Line | |
---|
[17] | 1 | . /usr/local/lib/7dtd/common.sh
|
---|
[18] | 2 | checkRootLoadConf
|
---|
[17] | 3 |
|
---|
| 4 | _sdtd() {
|
---|
| 5 | local cur prev opts
|
---|
| 6 | COMPREPLY=()
|
---|
| 7 | cur="${COMP_WORDS[COMP_CWORD]}"
|
---|
| 8 | prev="${COMP_WORDS[COMP_CWORD-1]}"
|
---|
| 9 |
|
---|
| 10 | opts="help $(listCommands)"
|
---|
| 11 |
|
---|
| 12 | case "${COMP_CWORD}" in
|
---|
| 13 | 1)
|
---|
| 14 | COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) )
|
---|
| 15 | return 0
|
---|
| 16 | ;;
|
---|
| 17 | *)
|
---|
| 18 | if [ "$(type -t sdtdCommand$(camelcasePrep ${COMP_WORDS[1]})Expects)" = "function" ]; then
|
---|
| 19 | COMPREPLY=( $(compgen -W "$(sdtdCommand$(camelcasePrep ${COMP_WORDS[1]})Expects $COMP_CWORD)" -- ${cur}) )
|
---|
| 20 | return 0
|
---|
| 21 | fi
|
---|
| 22 | ;;
|
---|
| 23 | esac
|
---|
| 24 | }
|
---|
| 25 | complete -F _sdtd 7dtd.sh
|
---|
Note:
See
TracBrowser
for help on using the repository browser.