]> git.ipfire.org Git - thirdparty/util-linux.git/blame - bash-completion/swaplabel
rev: be careful with close()
[thirdparty/util-linux.git] / bash-completion / swaplabel
CommitLineData
bf60993c
SK
1_swaplabel_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 '-L'|'--label')
9 COMPREPLY=( $(compgen -W "label" -- $cur) )
10 return 0
11 ;;
12 '-U'|'--uuid')
13 COMPREPLY=( $(compgen -W '$(uuidgen)' -- $cur) )
14 return 0
15 ;;
d4f9b8d7
VS
16 '-h'|'--help'|'-V'|'--version')
17 return 0
18 ;;
bf60993c
SK
19 esac
20 case $cur in
21 -*)
0d5b9b8a 22 OPTS="--label --uuid --help --version"
bf60993c
SK
23 COMPREPLY=( $(compgen -W "${OPTS[*]}" -- $cur) )
24 return 0
25 ;;
26 esac
ce3e6b15 27 local IFS=$'\n'
bf60993c
SK
28 compopt -o filenames
29 COMPREPLY=( $(compgen -f -- $cur) )
30 return 0
31}
32complete -F _swaplabel_module swaplabel