]> git.ipfire.org Git - thirdparty/util-linux.git/blob - bash-completion/swapoff
rev: be careful with close()
[thirdparty/util-linux.git] / bash-completion / swapoff
1 _swapoff_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 '-a'|'--all')
9 return 0
10 ;;
11 '-U'|'UUID=')
12 COMPREPLY=( $(compgen -W "$(swapon --show=UUID --noheading)" -- $cur) )
13 return 0
14 ;;
15 '-L'|'LABEL=')
16 COMPREPLY=( $(compgen -W "$(swapon --show=LABEL --noheading)" -- $cur) )
17 return 0
18 ;;
19 '-h'|'--help'|'-V'|'--version')
20 return 0
21 ;;
22 esac
23 case $cur in
24 -*)
25 OPTS="-L
26 -U
27 --all
28 --verbose
29 --help
30 --version"
31 COMPREPLY=( $(compgen -W "${OPTS[*]}" -- $cur) )
32 return 0
33 ;;
34 esac
35 COMPREPLY=( $(compgen -W "$(swapon --show=NAME --raw --noheading)" -- $cur) )
36 return 0
37 }
38 complete -F _swapoff_module swapoff