blob: 9a31fa5ed2a9bb1c7bcf1e618b15c6c90c62f6fd [file] [log] [blame]
Frederic Weisbecker98a41792012-08-09 16:31:51 +02001# perf completion
2
3have perf &&
4_perf()
5{
6 local cur cmd
7
8 COMPREPLY=()
9 _get_comp_words_by_ref cur
10
11 cmd=${COMP_WORDS[0]}
12
13 # List perf subcommands
14 if [ $COMP_CWORD -eq 1 ]; then
15 cmds=$($cmd --list-cmds)
16 COMPREPLY=( $( compgen -W '$cmds' -- "$cur" ) )
17 # Fall down to list regular files
18 else
19 _filedir
20 fi
21} &&
22complete -F _perf perf