File: _default

package info (click to toggle)
zsh 5.9-8
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 23,856 kB
  • sloc: ansic: 108,138; sh: 6,976; makefile: 722; perl: 687; awk: 291; sed: 16
file content (27 lines) | stat: -rw-r--r-- 682 bytes parent folder | download | duplicates (17)
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
#compdef -default-

local ctl

if { zstyle -s ":completion:${curcontext}:" use-compctl ctl ||
     zmodload -e zsh/compctl } && [[ "$ctl" != (no|false|0|off) ]]; then
  local opt

  opt=()
  [[ "$ctl" = *first* ]] && opt=(-T)
  [[ "$ctl" = *default* ]] && opt=("$opt[@]" -D)
  compcall "$opt[@]" || return 0
fi

_files "$@" && return 0

# magicequalsubst allows arguments like <any-old-stuff>=~/foo to do
# file name expansion after the =.  In that case, it's natural to
# allow completion to handle file names after any equals sign.

if [[ -o magicequalsubst && "$PREFIX" = *\=* ]]; then
  compstate[parameter]="${PREFIX%%\=*}"
  compset -P 1 '*='
  _value "$@"
else
  return 1
fi