about summary refs log tree commit diff
path: root/Completion/Zsh/Type/_globflags
blob: 5833dc8f17f066b490904013ee0fe6ace06839b7 (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
32
33
34
35
36
37
38
39
40
41
42
43
44
#autoload

local ret=1
local -a flags

if compset -P a; then
  _message -e number 'errors'
  return
elif compset -P q; then
  _globquals
  return
elif compset -P 'c[0-9]##,'; then
  _message -e number 'max repetitions'
  return
elif compset -P c; then
  _message -e number 'repetitions (min or exact)'
  return
fi

flags=(
  'i:case insensitive'
  'l:lower case characters match uppercase'
  'I:case sensitive matching'
  's:match start of string'
  'e:match end of string'
  'U:consider all characters to be one byte'
  'u:support multibyte characters in pattern'
)
[[ $compstate[context] = condition ]] && flags+=(
  'b:activate backreferences'
  'B:deactivate backreferences'
  'm:set reference to entire matched data'
  'M:deactivate m flag'
)

_describe -t globflags "glob flag" flags -Q -S ')' && ret=0
flags=(
  'a:approximate matching'
  'q:introduce glob qualifier'
  'c:match repetitions of preceding pattern'
)
_describe -t globflags "glob flag" flags -Q -S '' && ret=0

return ret