]>
Commit | Line | Data |
---|---|---|
723ec124 SK |
1 | _lsirq_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 | '-o'|'--output') | |
9 | local prefix realcur OUTPUT | |
10 | realcur="${cur##*,}" | |
11 | prefix="${cur%$realcur}" | |
12 | for WORD in "IRQ TOTAL NAME"; do | |
13 | if ! [[ $prefix == *"$WORD"* ]]; then | |
14 | OUTPUT="$WORD ${OUTPUT:-""}" | |
15 | fi | |
16 | done | |
17 | compopt -o nospace | |
18 | COMPREPLY=( $(compgen -P "$prefix" -W "$OUTPUT" -S ',' -- $realcur) ) | |
19 | return 0 | |
20 | ;; | |
21 | '-s'|'--sort') | |
22 | COMPREPLY=( $(compgen -W "irq total name" -- $cur) ) | |
23 | return 0 | |
24 | ;; | |
25 | '-h'|'--help'|'-V'|'--version') | |
26 | return 0 | |
27 | ;; | |
28 | esac | |
29 | OPTS=" --json | |
30 | --pairs | |
5adb0c90 | 31 | --noheadings |
723ec124 | 32 | --output |
6e7fb6c4 | 33 | --softirq |
723ec124 SK |
34 | --sort |
35 | --help | |
36 | --version" | |
37 | COMPREPLY=( $(compgen -W "${OPTS[*]}" -- $cur) ) | |
38 | return 0 | |
39 | } | |
40 | complete -F _lsirq_module lsirq |