-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
perf tools: Initial bash completion support
This implements bash completion for perf subcommands such as record, report, script, probe, etc... Signed-off-by: Frederic Weisbecker <fweisbec@gmail.com> Cc: David Ahern <dsahern@gmail.com> Cc: Ingo Molnar <mingo@kernel.org> Cc: Jiri Olsa <jolsa@redhat.com> Cc: Namhyung Kim <namhyung@gmail.com> Cc: Peter Zijlstra <a.p.zijlstra@chello.nl> Cc: Stephane Eranian <eranian@google.com> Link: http://lkml.kernel.org/r/1344522713-27951-2-git-send-email-fweisbec@gmail.com Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
- Loading branch information
Frederic Weisbecker
authored and
Arnaldo Carvalho de Melo
committed
Aug 9, 2012
1 parent
d25dcba
commit 98a4179
Showing
3 changed files
with
62 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
# perf completion | ||
|
||
have perf && | ||
_perf() | ||
{ | ||
local cur cmd | ||
|
||
COMPREPLY=() | ||
_get_comp_words_by_ref cur | ||
|
||
cmd=${COMP_WORDS[0]} | ||
|
||
# List perf subcommands | ||
if [ $COMP_CWORD -eq 1 ]; then | ||
cmds=$($cmd --list-cmds) | ||
COMPREPLY=( $( compgen -W '$cmds' -- "$cur" ) ) | ||
# Fall down to list regular files | ||
else | ||
_filedir | ||
fi | ||
} && | ||
complete -F _perf perf |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters