about summary refs log tree commit diff
path: root/Completion/Core/_wanted
blob: f95d74451286da1a821775b6655c8ed590de1a20 (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
#autoload

local targs tag

if [[ "$1" = -C?* ]]; then
  targs=( -C "${1[3,-1]}" )
  shift
elif [[ "$1" = -C ]]; then
  targs=( -C "$2" )
  shift 2
else
  targs=()
fi

if [[ "$1" = -[VJ]* ]]; then
  tag="$2"
else
  tag="$1"
fi

if [[ $# -gt 1 ]]; then
  _tags "$targs[@]" "$tag" && _description "$@"
else
  _tags "$targs[@]" "$tag"
fi