fi
}
-type perf &>/dev/null &&
-_perf()
+__perf_main ()
{
- local cur words cword prev cmd
-
- COMPREPLY=()
- _get_comp_words_by_ref -n =: cur words cword prev
+ local cmd
cmd=${words[0]}
+ COMPREPLY=()
# List perf subcommands or long options
if [ $cword -eq 1 ]; then
opts=$($cmd $subcmd --list-opts)
COMPREPLY=( $( compgen -W '$opts' -- "$cur" ) )
fi
+}
+
+type perf &>/dev/null &&
+_perf()
+{
+ local cur words cword prev
+ _get_comp_words_by_ref -n =: cur words cword prev
+ __perf_main
} &&
complete -o bashdefault -o default -o nospace -F _perf perf 2>/dev/null \