| cur="${COMP_WORDS[COMP_CWORD]}" |
| prev="${COMP_WORDS[COMP_CWORD-1]}" |
| PIDS=$(cd /proc && echo [0-9]*) |
| COMPREPLY=( $(compgen -W "$PIDS" -- $cur) ) |
| local prefix realcur OUTPUT_ALL OUTPUT |
| OUTPUT_ALL="DESCRIPTION RESOURCE SOFT HARD UNITS" |
| for WORD in $OUTPUT_ALL; do |
| if ! [[ $prefix == *"$WORD"* ]]; then |
| OUTPUT="$WORD ${OUTPUT:-""}" |
| COMPREPLY=( $(compgen -P "$prefix" -W "$OUTPUT" -S ',' -- $realcur) ) |
| '-h'|'--help'|'-V'|'--version') |
| # FIXME: is there anything what could be printed |
| COMPREPLY=( $(compgen -W "${OPTS[*]}" -- $cur) ) |
| COMPREPLY=( $(compgen -c -- $cur) ) |
| complete -F _prlimit_module prlimit |