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