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

Last change on this file since 17 was 17, checked in by alloc, 12 years ago

Version 4

File size: 547 bytes
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}
24complete -F _sdtd 7dtd.sh
Note: See TracBrowser for help on using the repository browser.