File: driverctl-bash-completion.sh

package info (click to toggle)
driverctl 0.101-1
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 128 kB
  • sloc: sh: 280; makefile: 47
file content (40 lines) | stat: -rw-r--r-- 805 bytes parent folder | download
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
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
# driverctl completion

_driverctl()
{
	local cur prev words cword
	_init_completion || return

	case $prev in
	     load-override|set-override|unset-override)
		COMPREPLY=($(compgen -W '$(${1:-driverctl} list-devices | cut -d" " -f1)' -- "$cur"))
		return 0
	     ;;
	     driverctl)
	     	case $cur in
	     	l*)
			COMPREPLY=( "list-devices" "list-overrides" "load-override" )
			return 0
			;;
	     	u*)
			COMPREPLY=( "unset-override" )
			return 0
			;;
	     	s*)
			COMPREPLY=( "set-override" )
			return 0
			;;
		*)
		        COMPREPLY=( --bus= --noprobe --nosave --verbose list-devices list-overrides load-override set-override unset-override )
			return 0
	     		;;
		esac
		;;
	     *)
	        echo -en "<driver>\b\b\b\b\b\b\b\b"
		return 0
		;;
	esac

}
complete -F _driverctl driverctl