aboutsummaryrefslogtreecommitdiffstats
path: root/tools/perf/perf-completion.sh
diff options
context:
space:
mode:
authorRamkumar Ramachandra <artagnon@gmail.com>2014-03-03 20:26:36 -0500
committerArnaldo Carvalho de Melo <acme@redhat.com>2014-03-14 17:08:41 -0400
commit09a71b97cce70551356b13b668aa1d7d6da84457 (patch)
tree47f628218b6a436fe565484a0a65360cd72c162d /tools/perf/perf-completion.sh
parent94a0793ddf7fa9890006a8dc203b985e7b120785 (diff)
perf kvm: introduce --list-cmds for use by scripts
Introduce $ perf kvm --list-cmds to dump a raw list of commands for use by the completion script. In order to do this, introduce parse_options_subcommand() for handling subcommands as a special case in the parse-options machinery. Signed-off-by: Ramkumar Ramachandra <artagnon@gmail.com> Acked-by: David Ahern <dsahern@gmail.com> Acked-by: Jiri Olsa <jolsa@redhat.com> Cc: David Ahern <dsahern@gmail.com> Link: http://lkml.kernel.org/r/1393896396-10427-1-git-send-email-artagnon@gmail.com Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/perf/perf-completion.sh')
-rw-r--r--tools/perf/perf-completion.sh2
1 files changed, 1 insertions, 1 deletions
diff --git a/tools/perf/perf-completion.sh b/tools/perf/perf-completion.sh
index 496e2abb5482..ae3a57694b6b 100644
--- a/tools/perf/perf-completion.sh
+++ b/tools/perf/perf-completion.sh
@@ -123,7 +123,7 @@ __perf_main ()
123 __perfcomp_colon "$evts" "$cur" 123 __perfcomp_colon "$evts" "$cur"
124 # List subcommands for 'perf kvm' 124 # List subcommands for 'perf kvm'
125 elif [[ $prev == "kvm" ]]; then 125 elif [[ $prev == "kvm" ]]; then
126 subcmds="top record report diff buildid-list stat" 126 subcmds=$($cmd $prev --list-cmds)
127 __perfcomp_colon "$subcmds" "$cur" 127 __perfcomp_colon "$subcmds" "$cur"
128 # List long option names 128 # List long option names
129 elif [[ $cur == --* ]]; then 129 elif [[ $cur == --* ]]; then