File: doh-cli.bash

package info (click to toggle)
doh-cli 0.8-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 216 kB
  • sloc: python: 142; sh: 24; makefile: 4
file content (23 lines) | stat: -rw-r--r-- 640 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
# bash completion for doh-cli(1)

_doh-cli() {
  local cur prev words

  _get_comp_words_by_ref cur prev

  if [[ ${cur} == -* ]] ; then
    words="--debug --dns --dnssec -h --help --json --time --url --verbose -v --version"
  else
    case "${prev}" in
      --dns)
        words="libredns libredns-ads google cloudflare quad9 cleanbrowsing cleanbrowsing-secure cleanbrowsing-adult cira cira-protect cira-family securedns securedns-ads"
        ;;
      *)
        words="A AAAA CNAME HTTPS MX NS SOA SPF SRV SVCB TXT CAA DNSKEY DS"
        ;;
    esac
  fi
  COMPREPLY=($(compgen -W "${words}" -- ${cur}))
}

complete -F _doh-cli doh-cli