about summary refs log tree commit diff
path: root/Completion/User/_a2ps
blob: 26f4d200eee7f079620a3f82338eb0691499af61 (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
35
36
37
38
39
#compdef a2ps

# This is for the GNU version of a2ps.

if [[ "$words[1]" != "$_a2ps_cache_cmd" ]]; then
  local descr

  _a2ps_cache_cmd="$words[1]"

  descr=( "${(@)${(f@)$($words[1] --list=features)//
 /	}:#}" )

  _a2ps_cache_values=(
      "${descr[(r)Known style sheets*]#*	}"
      "${descr[(r)Known encodings*]#*	}"
      "${descr[(r)Known media*]#*	}"
      "${descr[(r)Known prologues*]#*	}"
      "${descr[(r)Known PostScript Printer Descriptions*]#*	}"
      "${descr[(r)Known output destination*]#*	}"
      "${descr[(r)Known user options*]#*	}"
      "${descr[(r)Known Variables*]#*	}"
  )
fi

_long_options -t '*\*'                '(yes no)' \
                 '*=DIRECTION'        '(rows columns)' \
                 '*=TYPE'             '(r n nr rn any)' \
		 '--highlight-level*' '(none normal heavy)' \
		 '--version-control*' '(none off t numbered nil 
		                        existing never simple)' \
	         '--pretty-print*'    "[${_a2ps_cache_values[1]}]" \
	         '--encoding*'        "(${_a2ps_cache_values[2]})" \
	         '--medium*'          "[${_a2ps_cache_values[3]}]" \
	         '--prologue*'        "[${_a2ps_cache_values[4]}]" \
	         '--ppd*'             "[${_a2ps_cache_values[5]}]" \
	         '--printer*'         "[${_a2ps_cache_values[6]}]" \
	         '--user-option*'     "[${_a2ps_cache_values[7]}]" \
	         '--variable*'        "[${_a2ps_cache_values[8]}]" ||
    _files -F fignore -g '*~*.(ps|PS|eps|EPS)'