diff options
Diffstat (limited to '')
-rw-r--r-- | tools/perf/perf-completion.sh | 21 |
1 files changed, 12 insertions, 9 deletions
diff --git a/tools/perf/perf-completion.sh b/tools/perf/perf-completion.sh index c2595e9bd69b..4822ed38e23e 100644 --- a/tools/perf/perf-completion.sh +++ b/tools/perf/perf-completion.sh @@ -119,15 +119,18 @@ __perf_main () elif [[ $prev == "-e" && "${words[1]}" == @(record|stat|top) ]]; then evts=$($cmd list --raw-dump) __perfcomp_colon "$evts" "$cur" - # List subcommands for perf commands - elif [[ $prev == @(kvm|kmem|mem|lock|sched) ]]; then - subcmds=$($cmd $prev --list-cmds) - __perfcomp_colon "$subcmds" "$cur" - # List long option names - elif [[ $cur == --* ]]; then - subcmd=${words[1]} - opts=$($cmd $subcmd --list-opts) - __perfcomp "$opts" "$cur" + else + # List subcommands for perf commands + if [[ $prev == @(kvm|kmem|mem|lock|sched) ]]; then + subcmds=$($cmd $prev --list-cmds) + __perfcomp_colon "$subcmds" "$cur" + fi + # List long option names + if [[ $cur == --* ]]; then + subcmd=${words[1]} + opts=$($cmd $subcmd --list-opts) + __perfcomp "$opts" "$cur" + fi fi } |