]> git.ipfire.org Git - thirdparty/util-linux.git/blob - bash-completion/flock
rev: be careful with close()
[thirdparty/util-linux.git] / bash-completion / flock
1 _flock_module()
2 {
3 local cur prev OPTS
4 COMPREPLY=()
5 cur="${COMP_WORDS[COMP_CWORD]}"
6 prev="${COMP_WORDS[COMP_CWORD-1]}"
7 case $prev in
8 '-w'|'--timeout')
9 COMPREPLY=( $(compgen -W "seconds" -- $cur) )
10 return 0
11 ;;
12 '-E'|'--conflict-exit-code')
13 COMPREPLY=( $(compgen -W "{0..255}" -- $cur) )
14 return 0
15 ;;
16 '-c'|'--command')
17 compopt -o bashdefault
18 COMPREPLY=( $(compgen -c -- $cur) )
19 return 0
20 ;;
21 '-h'|'--help'|'-V'|'--version')
22 return 0
23 ;;
24 esac
25 case $cur in
26 -*)
27 OPTS="--shared
28 --exclusive
29 --unlock
30 --nonblock
31 --timeout
32 --conflict-exit-code
33 --close
34 --command
35 --no-fork
36 --help
37 --version"
38 COMPREPLY=( $(compgen -W "${OPTS[*]}" -- $cur) )
39 return 0
40 ;;
41 esac
42 local IFS=$'\n'
43 compopt -o filenames
44 COMPREPLY=( $(compgen -f -- ${cur:-"/"}) )
45 return 0
46 }
47 complete -F _flock_module flock