Changeset 420 for trunk/tssh/tssh.bash_completion
- Timestamp:
- Nov 25, 2019, 9:21:53 AM (5 years ago)
- File:
-
- 1 copied
Legend:
- Unmodified
- Added
- Removed
-
trunk/tssh/tssh.bash_completion
r414 r420 1 # bash completion for ddt1 # bash completion for tssh 2 2 3 have ddt&&4 _ ddt() {3 have tssh && 4 _tssh() { 5 5 local cur prev 6 6 … … 10 10 prev="${COMP_WORDS[COMP_CWORD-1]}" 11 11 12 case $prev in13 -b|--bootp)14 local showlist=$(ddt show-pxe --no-header|awk '{print $1}')15 COMPREPLY=($(compgen -W "${showlist}" -- "$cur"))16 return 017 ;;18 -d|-s|--sector)19 local showlist=$(ddt show-sector --no-header|awk '{print $1}')20 COMPREPLY=($(compgen -W "${showlist}" -- "$cur"))21 return 022 ;;23 -p|--pool)24 local showlist=$(ddt show-pool --no-header|awk '{print $1}')25 COMPREPLY=($(compgen -W "${showlist}" -- "$cur"))26 return 027 ;;28 -k|--kind)29 COMPREPLY=($(compgen -W "dhcp pool-dhcp fix-address" -- "$cur"))30 return 031 ;;32 -t|--tag)33 local showlist=$(ddt show-tag --no-header|awk '{print $1}')34 COMPREPLY=($(compgen -W "${showlist}" -- "$cur"))35 return 036 ;;37 esac38 39 12 if [[ "$cur" == '-*' || $COMP_CWORD -gt 1 ]] 40 13 then 41 COMPREPLY=($(compgen -W "$( ddt help|grep "^ ddt ${COMP_WORDS[1]}"|sed -e 's/[\[]/\n/g;'|grep -- '^-'|cut -f 1 -d ']'|cut -f 1 -d ' '|sed -e 's/|/ /g;'|xargs echo -n)" -- "$cur"))14 COMPREPLY=($(compgen -W "$(tssh -h|grep '^ tssh'|sed -e 's/[\[]/\n/g;'|grep -- '^-'|cut -f 1 -d ']'|cut -f 1 -d ' '|sed -e 's/|/ /g;'|xargs echo -n)" -- "$cur")) 42 15 else 43 COMPREPLY=($(compgen -W "$( $(which ddt||echo /usr/local/bin/ddt) help|grep '^ ddt'|awk '{print $2}'|xargs echo -n)" -- "$cur"))16 COMPREPLY=($(compgen -W "$(tssh -h|grep '^ tssh'|sed -e 's/[\[]/\n/g;'|grep -- '^-'|cut -f 1 -d ']'|cut -f 1 -d ' '|sed -e 's/|/ /g;'|xargs echo -n)" -- "$cur")) 44 17 fi 45 18 46 } && complete -F _ddt ddt 47 48 have dhcp-dns-tools && complete -F _ddt dhcp-dns-tools 19 } && complete -F _tssh tssh
Note: See TracChangeset
for help on using the changeset viewer.