about summary refs log tree commit diff
path: root/Completion/Unix/Command/_attr
blob: c7ca1b850339c287650c511c9ca3ab238025dd5a (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
45
46
47
48
#compdef attr getfattr setfattr

case $service in
  attr)
    local -a list
    [[ $OSTYPE = irix* ]] &&
        list=( '(-g -s -r -V)-l[list extended attributes associated with file]' )
    _arguments -s -S "$list[@]" \
      '(-l -r -s -V)-g[get extended attribute for file]:attribute name' \
      '(-l -g -s -q -V)-r[remove given attribute from file]:attribute name' \
      '(-l -g -r)-s[set named attribute for file]:attribute name' \
      '(-r)-q[quiet output]' \
      '(-g -r)-V[specify value of attribute]:value' \
      '-L[dereference symbolic links]' \
      '-R[operator in the root attribute namespace]' \
      '1:file:_files'
    return
  ;;
  getfattr)
    _arguments -s -S \
      '(-d --dump -n --name)'{-n+,--name=}'[dump the value of the named extended attribute]' \
      '(-n --name -d --dump)'{-d,--dump}'[dump the values of all extended attributes]' \
      '(-e --encoding)'{-e+,--encoding=}'[encode values after retrieving them]:encoding:(text hex base64)' \
      '(-h --no-derference)'{-h,--no-dereference}'[do not follow symbolic links]' \
      '(-m --match)'{-m+,--match=}'[only include attributes with names matching regex]:regular expression' \
      '--absolute-names[do not string leasing slash characters]' \
      '--only-values[dump only attribute values]' \
      '(-R --recursive)'{-R,--recursive}'[list attributes of all files and directories recurively]' \
      '(-P --physical -L --logical)'{-L,--logical}'[follow all symbolic links]' \
      '(-L --logical -P --physical)'{-P,--physical}'[skip all symbolic links]' \
      '(* -)--version[display version information]' \
      '(* -)--help[display help information]' \
      '*:file:_files'
    return
  ;;
  setfattr)
    _arguments -s -S \
      '(-n --name)'{-n+,--name=}'[specify extended attribute to set]' \
      '(-v --value)'{-v+,--value=}'[specify value for the attribute]' \
      '(-x --remove)'{-x+,--remove=}'[remove specified extended attribute]' \
      '(-n --name -v --value)--restore[restore extended attributes from dump file]:dump file:_files' \
      '(-h --no-derference)'{-h,--no-dereference}'[do not follow symbolic links]' \
      '(* -)--version[display version information]' \
      '(* -)--help[display help information]' \
      '*:file:_files'
    return
  ;;
esac