]>
Commit | Line | Data |
---|---|---|
18b0017a SK |
1 | _chrt_module() |
2 | { | |
d4f9b8d7 | 3 | local cur prev OPTS |
18b0017a SK |
4 | COMPREPLY=() |
5 | cur="${COMP_WORDS[COMP_CWORD]}" | |
d4f9b8d7 VS |
6 | prev="${COMP_WORDS[COMP_CWORD-1]}" |
7 | case $prev in | |
8 | '-h'|'--help'|'-V'|'--version') | |
9 | return 0 | |
10 | ;; | |
11 | esac | |
18b0017a SK |
12 | # FIXME: -p is ambiguous, it takes either pid or priority as an |
13 | # argument depending on whether user wanted to get or set the | |
14 | # values. Perhaps the command interface should be reconsidered. | |
15 | case $cur in | |
16 | -*) | |
0d5b9b8a VS |
17 | OPTS="--batch |
18 | --fifo | |
19 | --idle | |
20 | --other | |
21 | --rr | |
22 | --reset-on-fork | |
23 | --all-tasks | |
24 | --help | |
25 | --max | |
26 | --pid | |
27 | --verbose | |
28 | --version" | |
18b0017a SK |
29 | COMPREPLY=( $(compgen -W "${OPTS[*]}" -- $cur) ) |
30 | return 0 | |
31 | ;; | |
32 | esac | |
33 | local PIDS | |
34 | PIDS=$(for I in /proc/[0-9]*; do echo ${I##"/proc/"}; done) | |
35 | COMPREPLY=( $(compgen -W "$PIDS" -- $cur) ) | |
36 | return 0 | |
37 | } | |
38 | complete -F _chrt_module chrt |