aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--tools/perf/bash_completion12
1 files changed, 6 insertions, 6 deletions
diff --git a/tools/perf/bash_completion b/tools/perf/bash_completion
index ee9c6d85f2c9..62e157db2e2b 100644
--- a/tools/perf/bash_completion
+++ b/tools/perf/bash_completion
@@ -92,15 +92,15 @@ __ltrim_colon_completions()
92type perf &>/dev/null && 92type perf &>/dev/null &&
93_perf() 93_perf()
94{ 94{
95 local cur prev cmd 95 local cur words cword prev cmd
96 96
97 COMPREPLY=() 97 COMPREPLY=()
98 _get_comp_words_by_ref -n : cur prev 98 _get_comp_words_by_ref -n =: cur words cword prev
99 99
100 cmd=${COMP_WORDS[0]} 100 cmd=${words[0]}
101 101
102 # List perf subcommands or long options 102 # List perf subcommands or long options
103 if [ $COMP_CWORD -eq 1 ]; then 103 if [ $cword -eq 1 ]; then
104 if [[ $cur == --* ]]; then 104 if [[ $cur == --* ]]; then
105 COMPREPLY=( $( compgen -W '--help --version \ 105 COMPREPLY=( $( compgen -W '--help --version \
106 --exec-path --html-path --paginate --no-pager \ 106 --exec-path --html-path --paginate --no-pager \
@@ -110,13 +110,13 @@ _perf()
110 COMPREPLY=( $( compgen -W '$cmds' -- "$cur" ) ) 110 COMPREPLY=( $( compgen -W '$cmds' -- "$cur" ) )
111 fi 111 fi
112 # List possible events for -e option 112 # List possible events for -e option
113 elif [[ $prev == "-e" && "${COMP_WORDS[1]}" == @(record|stat|top) ]]; then 113 elif [[ $prev == "-e" && "${words[1]}" == @(record|stat|top) ]]; then
114 evts=$($cmd list --raw-dump) 114 evts=$($cmd list --raw-dump)
115 COMPREPLY=( $( compgen -W '$evts' -- "$cur" ) ) 115 COMPREPLY=( $( compgen -W '$evts' -- "$cur" ) )
116 __ltrim_colon_completions $cur 116 __ltrim_colon_completions $cur
117 # List long option names 117 # List long option names
118 elif [[ $cur == --* ]]; then 118 elif [[ $cur == --* ]]; then
119 subcmd=${COMP_WORDS[1]} 119 subcmd=${words[1]}
120 opts=$($cmd $subcmd --list-opts) 120 opts=$($cmd $subcmd --list-opts)
121 COMPREPLY=( $( compgen -W '$opts' -- "$cur" ) ) 121 COMPREPLY=( $( compgen -W '$opts' -- "$cur" ) )
122 fi 122 fi