5 cur="${COMP_WORDS[COMP_CWORD]}"
6 prev="${COMP_WORDS[COMP_CWORD-1]}"
9 COMPREPLY=( $(compgen -W "lzo lz4 lz4hc deflate 842" -- $cur) )
13 local prefix realcur OUTPUT_ALL OUTPUT
15 prefix="${cur%$realcur}"
16 OUTPUT_ALL="NAME DISKSIZE DATA COMPR ALGORITHM
17 STREAMS ZERO-PAGES TOTAL MEM-LIMIT MEM-USED
19 for WORD in $OUTPUT_ALL; do
20 if ! [[ $prefix == *"$WORD"* ]]; then
21 OUTPUT="$WORD ${OUTPUT:-""}"
25 COMPREPLY=( $(compgen -P "$prefix" -W "$OUTPUT" -S ',' -- $realcur) )
29 COMPREPLY=( $(compgen -W "size" -- $cur) )
33 COMPREPLY=( $(compgen -W "number" -- $cur) )
51 COMPREPLY=( $(compgen -W "${OPTS[*]}" -- $cur) )
57 COMPREPLY=( $(compgen -f -- ${cur:-"/dev/zram"}) )
60 complete -F _zramctl_module zramctl