]>
Commit | Line | Data |
---|---|---|
c6f8c3f5 SK |
1 | _renice_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 | '-g'|'--pgrp') | |
9 | local PGRP | |
10 | PGRP=$(ps -ax -opgrp | sed '1d') | |
11 | COMPREPLY=( $(compgen -W "$PGRP" -- $cur) ) | |
12 | return 0 | |
13 | ;; | |
14 | '-n'|'--priority') | |
d6b975ef | 15 | COMPREPLY=( $(compgen -W "{-20..20}" -- $cur) ) |
c6f8c3f5 SK |
16 | return 0 |
17 | ;; | |
18 | '-p'|'--pid') | |
19 | local PIDS | |
75c5f4a5 | 20 | PIDS=$(cd /proc && echo [0-9]*) |
c6f8c3f5 SK |
21 | COMPREPLY=( $(compgen -W "$PIDS" -- $cur) ) |
22 | return 0 | |
23 | ;; | |
24 | '-u'|'--user') | |
25 | COMPREPLY=( $(compgen -u -- $cur) ) | |
26 | return 0 | |
27 | ;; | |
d4f9b8d7 VS |
28 | '-h'|'--help'|'-V'|'--version') |
29 | return 0 | |
30 | ;; | |
c6f8c3f5 | 31 | esac |
0d5b9b8a VS |
32 | OPTS="--pgrp |
33 | --priority | |
34 | --pid | |
35 | --user | |
36 | --help | |
37 | --version" | |
c6f8c3f5 SK |
38 | COMPREPLY=( $(compgen -W "${OPTS[*]}" -- $cur) ) |
39 | return 0 | |
40 | } | |
41 | complete -F _renice_module renice |