about summary refs log tree commit diff
path: root/Completion/Base/Core/_normal
blob: 36ecb225d11cbe48db0f258aeb729f02b15e7ef8 (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
#compdef -command-line-

local _comp_command1 _comp_command2 _comp_command skip

if [[ "$1" = -s ]]; then
  skip=(-s)
else
  skip=()
  _compskip=''
fi

# Completing in command position?

if [[ CURRENT -eq 1 ]]; then
  curcontext="${curcontext%:*:*}:-command-:"

  comp="$_comps[-command-]"
  [[ -n "$comp" ]] && eval "$comp" && ret=0

  return ret
fi

_set_command

_dispatch "$skip[@]" "$_comp_command" \
          "$_comp_command1" "$_comp_command2" -default-