From: "Steven Rostedt (VMware)" <rostedt@xxxxxxxxxxx> Add a virsh lookup of guest names when -A is the option for trace-cmd record and tab is done. Signed-off-by: Steven Rostedt (VMware) <rostedt@xxxxxxxxxxx> --- tracecmd/trace-cmd.bash | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/tracecmd/trace-cmd.bash b/tracecmd/trace-cmd.bash index 85f6743b..e89c1a55 100644 --- a/tracecmd/trace-cmd.bash +++ b/tracecmd/trace-cmd.bash @@ -9,6 +9,17 @@ show_instances() return 0 } +show_virt() +{ + local cur="$1" + if ! which virsh &>/dev/null; then + return 1 + fi + local virt=`virsh list | awk '/^ *[0-9]/ { print $2 }'` + COMPREPLY=( $(compgen -W "${virt}" -- "${cur}") ) + return 0 +} + show_options() { local cur="$1" @@ -159,6 +170,11 @@ __trace_cmd_record_complete() -O) show_options "$cur" ;; + -A) + if ! show_virt "$cur"; then + cmd_options record "$cur" + fi + ;; *) # stream start and profile do not show all options cmd_options record "$cur" -- 2.29.2