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