Ignore:
Timestamp:
Nov 25, 2019, 9:21:53 AM (4 years ago)
Author:
g7moreau
Message:
  • Add everything to build a Debian package
File:
1 copied

Legend:

Unmodified
Added
Removed
  • trunk/tssh/tssh.bash_completion

    r414 r420  
    1 # bash completion for ddt
     1# bash completion for tssh
    22
    3 have ddt &&
    4 _ddt() {
     3have tssh &&
     4_tssh() {
    55   local cur prev
    66
     
    1010   prev="${COMP_WORDS[COMP_CWORD-1]}"
    1111
    12    case $prev in
    13       -b|--bootp)
    14          local showlist=$(ddt show-pxe --no-header|awk '{print $1}')
    15          COMPREPLY=($(compgen -W "${showlist}" -- "$cur"))
    16          return 0
    17          ;;
    18       -d|-s|--sector)
    19          local showlist=$(ddt show-sector --no-header|awk '{print $1}')
    20          COMPREPLY=($(compgen -W "${showlist}" -- "$cur"))
    21          return 0
    22          ;;
    23       -p|--pool)
    24          local showlist=$(ddt show-pool --no-header|awk '{print $1}')
    25          COMPREPLY=($(compgen -W "${showlist}" -- "$cur"))
    26          return 0
    27          ;;
    28       -k|--kind)
    29          COMPREPLY=($(compgen -W "dhcp pool-dhcp fix-address" -- "$cur"))
    30          return 0
    31          ;;
    32       -t|--tag)
    33          local showlist=$(ddt show-tag --no-header|awk '{print $1}')
    34          COMPREPLY=($(compgen -W "${showlist}" -- "$cur"))
    35          return 0
    36          ;;
    37    esac
    38 
    3912   if [[ "$cur" == '-*' || $COMP_CWORD -gt 1 ]]
    4013   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"))
    4215   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"))
    4417   fi
    4518
    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.