Debian Codegraph @

bash-completion/wipefs

raw
1 _wipefs_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 '-b'|'--backup')
9 COMPREPLY=( $(compgen -o dirnames -- ${cur:-"/"}) )
10 return 0
11 ;;
12 '-O'|'--output')
13 local prefix realcur OUTPUT_ALL OUTPUT
14 realcur="${cur##*,}"
15 prefix="${cur%$realcur}"
16 OUTPUT_ALL="UUID LABEL LENGTH TYPE OFFSET USAGE DEVICE"
17 for WORD in $OUTPUT_ALL; do
18 if ! [[ $prefix == *"$WORD"* ]]; then
19 OUTPUT="$WORD ${OUTPUT:-""}"
20 fi
21 done
22 compopt -o nospace
23 COMPREPLY=( $(compgen -P "$prefix" -W "$OUTPUT" -S ',' -- $realcur) )
24 return 0
25 ;;
26 '-o'|'--offset')
27 COMPREPLY=( $(compgen -W "offset" -- $cur) )
28 return 0
29 ;;
30 '-t'|'--types')
31 local TYPES
32 TYPES="$(command blkid -k)"
33 COMPREPLY=( $(compgen -W "$TYPES" -- $cur) )
34 return 0
35 ;;
36 '-h'|'--help'|'-V'|'--version')
37 return 0
38 ;;
39 esac
40 case $cur in
41 -*)
42 OPTS="
43 --all
44 --backup
45 --force
46 --noheadings
47 --json
48 --lock
49 --no-act
50 --offset
51 --output
52 --parsable
53 --quiet
54 --types
55 --help
56 --version
57 "
58 COMPREPLY=( $(compgen -W "${OPTS[*]}" -- $cur) )
59 return 0
60 ;;
61 esac
62 compopt -o bashdefault -o default
63 COMPREPLY=( $(compgen -W "$(command lsblk -pnro name)" -- $cur) )
64 return 0
65 }
66 complete -F _wipefs_module wipefs