File: bash

package info (click to toggle)
cpu-x 5.4.0-0.2
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 7,380 kB
  • sloc: ansic: 36,860; cpp: 8,094; asm: 7,291; sh: 693; xml: 190; makefile: 11
file content (25 lines) | stat: -rw-r--r-- 794 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
_cpu_x() {
	local cur prev display opts
	COMPREPLY=()
	cur="${COMP_WORDS[COMP_CWORD]}"
	prev="${COMP_WORDS[COMP_CWORD-1]}"
	display=(-G --gtk -N --ncurses -D --dump -M --dmidecode -B --bandwidth -h --help -V --version)
	opts=(-r --refresh -t --tab -c --core -b --cachetest -d --daemon -v --verbose --nocolor --issue-fmt --keymap)

	case $prev in
		-G|--gtk|-N|--ncurses|-D|dump|-M|--dmidecode|-B|--bandwidth)
			COMPREPLY=($(compgen -W "${opts[*]}" -- "$cur"))
			;;
		-h|--help|-V|--version)
			return 0
			;;
		-r|--refresh|-t|--tab|-c|--core|-b|--cachetest|-d|--daemon|-v|--verbose|--nocolor|--debug|--issue-fmt|--keymap)
			COMPREPLY=($(compgen -W "${opts[*]}" -- "$cur"))
			;;
		*)
			COMPREPLY=($(compgen -W "${display[*]} ${opts[*]}" -- "$cur"))
			;;
	esac
}

complete -F _cpu_x cpu-x