From 9cf3e5a3b6dc2d3a911521389bffe6f7bdd41861 Mon Sep 17 00:00:00 2001 From: Namhyung Kim Date: Wed, 3 Oct 2012 00:21:33 +0900 Subject: [PATCH] --- yaml --- r: 333954 b: refs/heads/master c: 35c2fde1155cc7225361edf43d8efd0aabd28a0c h: refs/heads/master v: v3 --- [refs] | 2 +- trunk/tools/perf/bash_completion | 12 +++++++++--- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/[refs] b/[refs] index db2a1bbe3833..6f30eb8cbece 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: a1d668c3ffd38d611f8446615e8f797dcfdfc397 +refs/heads/master: 35c2fde1155cc7225361edf43d8efd0aabd28a0c diff --git a/trunk/tools/perf/bash_completion b/trunk/tools/perf/bash_completion index 3d48cee1b5e5..bef06f0deeb5 100644 --- a/trunk/tools/perf/bash_completion +++ b/trunk/tools/perf/bash_completion @@ -21,10 +21,16 @@ _perf() cmd=${COMP_WORDS[0]} - # List perf subcommands + # List perf subcommands or long options if [ $COMP_CWORD -eq 1 ]; then - cmds=$($cmd --list-cmds) - COMPREPLY=( $( compgen -W '$cmds' -- "$cur" ) ) + if [[ $cur == --* ]]; then + COMPREPLY=( $( compgen -W '--help --version \ + --exec-path --html-path --paginate --no-pager \ + --perf-dir --work-tree --debugfs-dir' -- "$cur" ) ) + else + cmds=$($cmd --list-cmds) + COMPREPLY=( $( compgen -W '$cmds' -- "$cur" ) ) + fi # List possible events for -e option elif [[ $prev == "-e" && "${COMP_WORDS[1]}" == @(record|stat|top) ]]; then cmds=$($cmd list --raw-dump)