summaryrefslogtreecommitdiffstats
path: root/tools/perf/bash_completion
blob: 9a31fa5ed2a9bb1c7bcf1e618b15c6c90c62f6fd (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
# perf completion

have perf &&
_perf()
{
	local cur cmd

	COMPREPLY=()
	_get_comp_words_by_ref cur

	cmd=${COMP_WORDS[0]}

	# List perf subcommands
	if [ $COMP_CWORD -eq 1 ]; then
		cmds=$($cmd --list-cmds)
		COMPREPLY=( $( compgen -W '$cmds' -- "$cur" ) )
	# Fall down to list regular files
	else
		_filedir
	fi
} &&
complete -F _perf perf
OpenPOWER on IntegriCloud