]> git.ipfire.org Git - thirdparty/util-linux.git/blame - bash-completion/irqtop
Merge branch 'wipefs/improvements' of https://github.com/t-8ch/util-linux
[thirdparty/util-linux.git] / bash-completion / irqtop
CommitLineData
e11f2427
SK
1_irqtop_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
d1732bba 8 '-c'|'--cpu-stat')
17f7caa4 9 COMPREPLY=( $(compgen -W "auto enable disable" -- $cur) )
10 return 0
11 ;;
4b2fadb1 12 '-C'|'--cpu-list')
13 return 0
14 ;;
e11f2427
SK
15 '-d'|'--delay')
16 COMPREPLY=( $(compgen -W "secs" -- $cur) )
17 return 0
18 ;;
19 '-s'|'--sort')
723ec124 20 COMPREPLY=( $(compgen -W "irq total delta name" -- $cur) )
68afc56b
SK
21 return 0
22 ;;
723ec124 23 '-o'|'--output')
68afc56b
SK
24 local prefix realcur OUTPUT
25 realcur="${cur##*,}"
26 prefix="${cur%$realcur}"
27 for WORD in "IRQ TOTAL DELTA NAME"; do
28 if ! [[ $prefix == *"$WORD"* ]]; then
29 OUTPUT="$WORD ${OUTPUT:-""}"
30 fi
31 done
32 compopt -o nospace
33 COMPREPLY=( $(compgen -P "$prefix" -W "$OUTPUT" -S ',' -- $realcur) )
e11f2427
SK
34 return 0
35 ;;
36 '-h'|'--help'|'-V'|'--version')
37 return 0
38 ;;
39 esac
d1732bba 40 OPTS=" --cpu-stat
4b2fadb1 41 --cpu-list
17f7caa4 42 --delay
e11f2427 43 --sort
723ec124 44 --output
6e7fb6c4 45 --softirq
e11f2427
SK
46 --help
47 --version"
48 COMPREPLY=( $(compgen -W "${OPTS[*]}" -- $cur) )
49 return 0
50}
51complete -F _irqtop_module irqtop