diff options
Diffstat (limited to 'Completion/User/_gs')
-rw-r--r-- | Completion/User/_gs | 52 |
1 files changed, 45 insertions, 7 deletions
diff --git a/Completion/User/_gs b/Completion/User/_gs index a216e6325..7e86981e9 100644 --- a/Completion/User/_gs +++ b/Completion/User/_gs @@ -8,12 +8,50 @@ if compset -N --; then return 1 fi else + local state line ret=1 + typeset -A options + _x_arguments \ - -q \ - '-g-:device size (<width>x<height>):' \ - '-r-:resolution (<val> or <x>x<y>):' \ - '-I:search paths:_dir_list' \ - \*-{d,D}'-:def: _gs_name -d' \ - \*-{s,S}'-:def: _gs_name -s' \ - '*:PostScript file:_ps' + '-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 |