]> git.ipfire.org Git - thirdparty/util-linux.git/blob - bash-completion/mcookie
rev: be careful with close()
[thirdparty/util-linux.git] / bash-completion / mcookie
1 _mcookie_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 '-f'|'--file')
9 local IFS=$'\n'
10 compopt -o filenames
11 COMPREPLY=( $(compgen -f -- $cur) )
12 return 0
13 ;;
14 '-m'|'--max-size')
15 COMPREPLY=( $(compgen -W "bytes" -- $cur) )
16 return 0
17 ;;
18 '-h'|'--help'|'-V'|'--version')
19 return 0
20 ;;
21 esac
22 case $cur in
23 -*)
24 OPTS="--file --max-size --verbose --version --help"
25 COMPREPLY=( $(compgen -W "${OPTS[*]}" -- $cur) )
26 return 0
27 ;;
28 esac
29 return 0
30 }
31 complete -F _mcookie_module mcookie