Debian Codegraph @

bash-completion/mkswap

raw
1 _mkswap_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 '-p'|'--pagesize')
9 COMPREPLY=( $(compgen -W "bytes" -- $cur) )
10 return 0
11 ;;
12 '-L'|'--label')
13 COMPREPLY=( $(compgen -W "label" -- $cur) )
14 return 0
15 ;;
16 '-v'|'--swapversion')
17 COMPREPLY=( $(compgen -W "1" -- $cur) )
18 return 0
19 ;;
20 '-U'|'--uuid')
21 COMPREPLY=( $(compgen -W "$(command uuidgen -r)" -- $cur) )
22 return 0
23 ;;
24 '-o'|'--offset')
25 COMPREPLY=( $(compgen -W "bytes" -- $cur) )
26 return 0
27 ;;
28 '-s'|'--size')
29 COMPREPLY=( $(compgen -W "bytes" -- $cur) )
30 return 0
31 ;;
32 '-h'|'--help'|'-V'|'--version')
33 return 0
34 ;;
35 esac
36 case $cur in
37 -*)
38 OPTS="--check
39 --endianness
40 --quiet
41 --force
42 --pagesize
43 --lock
44 --label
45 --swapversion
46 --uuid
47 --offset
48 --verbose
49 --version
50 --help
51 --size
52 --file"
53 COMPREPLY=( $(compgen -W "${OPTS[*]}" -- $cur) )
54 return 0
55 ;;
56 esac
57 compopt -o bashdefault -o default
58 COMPREPLY=( $(compgen -W "$(command lsblk -pnro name)" -- $cur) )
59 return 0
60 }
61 complete -F _mkswap_module mkswap