about summary refs log tree commit diff
path: root/Completion/User/_archie
blob: 640fbc4ed3308e821621dc2e6e9d077f9179f96a (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#compdef archie

local context state line expl
typeset -A opt_args

_arguments -s \
  '-D+[debug level]:debug level:' \
  '-v[print version]' \
  '-V[verbose mode]' \
  '-O+[specifies offset]:offset:' \
  '-a[list matches as Alex filenames]' \
  '-c[case sensitive substring search]' \
  '-e[exact string match (default)]' \
  '-r[regular expression search]' \
  '-s[case insensitive substring search]' \
  '-l[list one match per line]' \
  '-t[sort inverted by date]' \
  '-m+[specifies maximum number of hits to return (default 95)]:hits to return:' \
  '-o+[specifies file to store results in]:file to store:' \
  '-h+[specifies server host]:server host:->serverhost' \
  '-L[list known servers and current default]' \
  '-N-[specifies query niceness level (0-35765)]:niceness level:' \
  ':string:'

case "$state" in
serverhost)
  : ${(A)archie_servers:=${(M)$(archie -L):#archie.*}}

  _tags "${context}:server" hosts || return 1

  _description expl 'archie servers'
  compadd "$expl[@]" -  $archie_servers
  ;;
esac