]> git.ipfire.org Git - thirdparty/util-linux.git/blame - bash-completion/swapoff
scriptreplay: cleanup usage()
[thirdparty/util-linux.git] / bash-completion / swapoff
CommitLineData
741fce34
BV
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=')
e3da3b39 12 COMPREPLY=( $(compgen -W "$(swapon --show=UUID --noheading)" -- $cur) )
741fce34
BV
13 return 0
14 ;;
15 '-L'|'LABEL=')
e3da3b39 16 COMPREPLY=( $(compgen -W "$(swapon --show=LABEL --noheading)" -- $cur) )
741fce34
BV
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
e3da3b39 35 COMPREPLY=( $(compgen -W "$(swapon --show=NAME --raw --noheading)" -- $cur) )
741fce34
BV
36 return 0
37}
38complete -F _swapoff_module swapoff