Implement the placeholder for tab completion of "trace-cmd reset". Apparently trace-cmd.bash already has support for instance buffers lookup (which is show_instances()). Employ it for -B option. Regarding -k option, show the list of dynamic event types to ease trace-cmd user's job. Signed-off-by: Metin Kaya <metin.kaya@xxxxxxx> --- tracecmd/trace-cmd.bash | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/tracecmd/trace-cmd.bash b/tracecmd/trace-cmd.bash index 66bd6f4b..01a75578 100644 --- a/tracecmd/trace-cmd.bash +++ b/tracecmd/trace-cmd.bash @@ -215,6 +215,33 @@ __trace_cmd_report_complete() esac } +dynevent_options() +{ + local cur="$1" + local opts=("kprobe" "kretprobe" "uprobe" "uretprobe" "eprobe" "synth" "all") + COMPREPLY=( $(compgen -W "${opts[*]}" -- "${cur}") ) +} + +__trace_cmd_reset_complete() +{ + local prev=$1 + local cur=$2 + shift 2 + local words=("$@") + + case "$prev" in + -B) + show_instances "$cur" + ;; + -k) + dynevent_options "$cur" + ;; + *) + cmd_options reset "$cur" + ;; + esac +} + __trace_cmd_dump_complete() { local prev=$1 @@ -329,6 +356,10 @@ _trace_cmd_complete() __trace_cmd_report_complete "${prev}" "${cur}" ${words[@]} return 0 ;; + reset) + __trace_cmd_reset_complete "${prev}" "${cur}" "${words[@]}" + return 0 + ;; dump) __trace_cmd_dump_complete "${prev}" "${cur}" ${words[@]} return 0 -- 2.34.1