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

local gropt=-J format

if [[ "$1" = -[VJ]* ]]; then
  gropt="$1"
  shift
fi

_lastdescr=( "$_lastdescr[@]" "$2" )

_style -s descriptions format format

if _style matches group; then
  if [[ -n "$format" ]]; then
    eval "$1=($gropt ${(q)2} -X ${(q)format//\\%d/$2})"
  else
    eval "$1=($gropt ${(q)2})"
  fi
else
  if [[ -n "$format" ]]; then
    eval "$1=(-X ${(q)format//\\%d/$2})"
  else
    eval "$1=()"
  fi
fi

return 0