Changeset 225 for trunk/ddt/ddt.bash_completion
- Timestamp:
- Jun 19, 2018, 6:16:08 PM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/ddt/ddt.bash_completion
r221 r225 1 # bash completion for d hcp-dns-tools1 # bash completion for ddt 2 2 3 have d hcp-dns-tools&&4 _d hcp_dns_tools() {3 have ddt && 4 _ddt() { 5 5 local cur prev 6 6 … … 12 12 case $prev in 13 13 -b|--bootp) 14 local showlist=$(d hcp-dns-toolsshow-pxe --no-header|awk '{print $1}')14 local showlist=$(ddt show-pxe --no-header|awk '{print $1}') 15 15 COMPREPLY=($(compgen -W "${showlist}" -- "$cur")) 16 16 return 0 17 17 ;; 18 18 -d|--domainset) 19 local showlist=$(d hcp-dns-toolsshow-domainset --no-header|awk '{print $1}')19 local showlist=$(ddt show-domainset --no-header|awk '{print $1}') 20 20 COMPREPLY=($(compgen -W "${showlist}" -- "$cur")) 21 21 return 0 22 22 ;; 23 23 -p|--pool) 24 local showlist=$(d hcp-dns-toolsshow-pool --no-header|awk '{print $1}')24 local showlist=$(ddt show-pool --no-header|awk '{print $1}') 25 25 COMPREPLY=($(compgen -W "${showlist}" -- "$cur")) 26 26 return 0 … … 31 31 ;; 32 32 -t|--tag) 33 local showlist=$(d hcp-dns-toolsshow-tag --no-header|awk '{print $1}')33 local showlist=$(ddt show-tag --no-header|awk '{print $1}') 34 34 COMPREPLY=($(compgen -W "${showlist}" -- "$cur")) 35 35 return 0 … … 39 39 if [[ "$cur" == '-*' || $COMP_CWORD -gt 1 ]] 40 40 then 41 COMPREPLY=($(compgen -W "$(d hcp-dns-tools help|grep "^ dhcp-dns-tools${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"))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")) 42 42 else 43 COMPREPLY=($(compgen -W "$($(which d hcp-dns-tools||echo /usr/local/bin/dhcp-dns-tools) help|grep '^ dhcp-dns-tools'|awk '{print $2}'|xargs echo -n)" -- "$cur"))43 COMPREPLY=($(compgen -W "$($(which ddt||echo /usr/local/bin/ddt) help|grep '^ ddt'|awk '{print $2}'|xargs echo -n)" -- "$cur")) 44 44 fi 45 45 46 # if [[ "$cur" == -* ]]; then 47 # COMPREPLY=( $( compgen -W '-h -d -i -p -m -c' -- "$cur" ) ) 48 # else 49 # COMPREPLY=( $( compgen -W 'add_alias add_dhcp add_float add_static add_virtual \ 50 # create_pool \ 51 # change_mac change_ip change_host change_comment change_tag change_domainset \ 52 # del_pc del_float \ 53 # disable_pc disable_float enable_pc enable_float \ 54 # gen_dhcp_file gen_dns_file check_dns \ 55 # load_database \ 56 # create_domainset show_domainset \ 57 # create_pxe remove_pxe show_pxe enable_pxe disable_pxe \ 58 # create_tag remove_tag show_tag \ 59 # show search_mac \ 60 # help' -- "$cur" ) ) 61 # fi 62 63 } && complete -F _dhcp_dns_tools dhcp-dns-tools 46 } && complete -F _dhcp_dns_tools ddt
Note: See TracChangeset
for help on using the changeset viewer.