about summary refs log tree commit diff
path: root/Completion/User/_gs_name
blob: 3aef646eb49349f818ed6f6b3a558e4be80b632f (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
#autoload

local expl

if [[ "$1" = -d ]]; then
  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
  fi
elif compset -P '*\='; then
  case "$IPREFIX" in
  *DEVICE\=)
    _description expl 'ghostscript device'
    compadd "$expl[@]" - "${(@)${=${$(gs -h)##* devices:}%%Search path:*}:#}"
    ;;
  *OutputFile\=)
    _description expl 'output file'
    _files
    ;;
  *)
    _message 'systemdict value'
    return 1
  esac
else
  _description expl 'systemdict name'
  compadd "$expl[@]" -S\= -M 'm:{a-z}={A-Z}' - DEVICE OutputFile
fi