aboutsummaryrefslogtreecommitdiff
path: root/2018-linuxdays/examples/bash/switch
blob: db55dd7b813fa1d2bdbce93a3e2b15d03c2df485 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
_sterm() {
	local cur prev words cword
	_init_completion || return
	case "$prev" in
		-b|-d|-r)
			# No completion for these
			;;
		-s)
			COMPREPLY=($(compgen -W "9600 19200 38400 57600 115200" -- ${cur}))
			;;
		*)
			COMPREPLY=($(compgen -W "-s -b -d -r" -- ${cur}))
			;;
	esac
}
complete -o default -F _sterm sterm