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() fi # List possible events for -e option elif [[ $prev == "-e" && "${COMP_WORDS[1]}" == @(record|stat|top) ]]; then - cmds=$($cmd list --raw-dump) - COMPREPLY=( $( compgen -W '$cmds' -- "$cur" ) ) + evts=$($cmd list --raw-dump) + COMPREPLY=( $( compgen -W '$evts' -- "$cur" ) ) + # List long option names + elif [[ $cur == --* ]]; then + subcmd=${COMP_WORDS[1]} + opts=$($cmd $subcmd --list-opts) + COMPREPLY=( $( compgen -W '$opts' -- "$cur" ) ) # Fall down to list regular files else _filedir |