5 cur="${COMP_WORDS[COMP_CWORD]}"
6 prev="${COMP_WORDS[COMP_CWORD-1]}"
22 COMPREPLY=( $(compgen -W "$FLAGS" -- $cur) )
26 local prefix realcur OUTPUT_ALL OUTPUT
28 prefix="${cur%$realcur}"
29 OUTPUT_ALL="FLAG DESCRIPTION STATUS BOOT-STATUS DEVICE"
30 for WORD in $OUTPUT_ALL; do
31 if ! [[ $prefix == *"$WORD"* ]]; then
32 OUTPUT="$WORD ${OUTPUT:-""}"
36 COMPREPLY=( $(compgen -P "$prefix" -W "$OUTPUT" -S ',' -- $realcur) )
40 COMPREPLY=( $(compgen -W "seconds" -- $cur) )
43 '-h'|'--help'|'-V'|'--version')
61 COMPREPLY=( $(compgen -W "${OPTS[*]}" -- $cur) )
67 COMPREPLY=( $(compgen -f -- ${cur:-"/dev/"}) )
70 complete -F _wdctl_module wdctl