blob: 7e86981e9e7d15dc445024922912bbeddc232d70 (
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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
|
#compdef gs ghostscript
if compset -N --; then
if [[ CURRENT -eq 1 ]]; then
_ps
else
_message 'userdict ARGUMENTS'
return 1
fi
else
local state line ret=1
typeset -A options
_x_arguments \
'-q[quiet startup]' \
'-g-[set device size]:device size (<width>x<height>):' \
'-r-[set resolution]:resolution (<val> or <x>x<y>):' \
'-I[add search paths]:search paths:_dir_list' \
\*-{d,D}'-[define name with definition]:def:->dname' \
\*-{s,S}'-[define name with value]:def:->sname' \
'*:PostScript file:_ps' && ret=0
case "$state" in
dname)
if [[ "$PREFIX" = *\=* ]]; then
_message 'systemdict definition value'
else
_description expl 'systemdict definition name'
compadd "$expl[@]" -M 'm:{a-z}={A-Z}' - \
DISKFONTS NOCACHE NOBIND NODISPLAY NOPAUSE PLATFONTS SAFER \
WRITESYSTEMDICT && ret=0
fi
;;
sname)
if compset -P '*\='; then
case "$IPREFIX" in
*DEVICE\=)
_description expl 'ghostscript device'
compadd "$expl[@]" - "${(@)${=${$(gs -h)##* devices:}%%Search path:*}:#}" && ret=0
;;
*OutputFile\=)
_description expl 'output file'
_files && ret=0
;;
*)
_message 'systemdict value'
return 1
esac
else
_description expl 'systemdict name'
compadd "$expl[@]" -S\= -M 'm:{a-z}={A-Z}' - DEVICE OutputFile && ret=0
fi
;;
esac
return ret
fi
|