diff options
Diffstat (limited to 'tools/perf/bash_completion')
-rw-r--r-- | tools/perf/bash_completion | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/tools/perf/bash_completion b/tools/perf/bash_completion index bef06f0deeb5..5c355ababf80 100644 --- a/tools/perf/bash_completion +++ b/tools/perf/bash_completion | |||
@@ -33,8 +33,13 @@ _perf() | |||
33 | fi | 33 | fi |
34 | # List possible events for -e option | 34 | # List possible events for -e option |
35 | elif [[ $prev == "-e" && "${COMP_WORDS[1]}" == @(record|stat|top) ]]; then | 35 | elif [[ $prev == "-e" && "${COMP_WORDS[1]}" == @(record|stat|top) ]]; then |
36 | cmds=$($cmd list --raw-dump) | 36 | evts=$($cmd list --raw-dump) |
37 | COMPREPLY=( $( compgen -W '$cmds' -- "$cur" ) ) | 37 | COMPREPLY=( $( compgen -W '$evts' -- "$cur" ) ) |
38 | # List long option names | ||
39 | elif [[ $cur == --* ]]; then | ||
40 | subcmd=${COMP_WORDS[1]} | ||
41 | opts=$($cmd $subcmd --list-opts) | ||
42 | COMPREPLY=( $( compgen -W '$opts' -- "$cur" ) ) | ||
38 | # Fall down to list regular files | 43 | # Fall down to list regular files |
39 | else | 44 | else |
40 | _filedir | 45 | _filedir |