source: scripts/etc/bash_completion.d/7dtd@ 18

Last change on this file since 18 was 18, checked in by alloc, 11 years ago

Version 4

File size: 565 bytes
RevLine 
[17]1. /usr/local/lib/7dtd/common.sh
[18]2checkRootLoadConf
[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}
25complete -F _sdtd 7dtd.sh
Note: See TracBrowser for help on using the repository browser.