Message ID | 20250408113704.42fb24c8@gandalf.local.home (mailing list archive) |
---|---|
State | Accepted |
Commit | f4ede17d96d3515afd866e834b7b5219ddedaf1f |
Headers | show |
Series | trace-cmd list: Show events in bash completion | expand |
diff --git a/tracecmd/trace-cmd.bash b/tracecmd/trace-cmd.bash index d7816bcf..ee7c79a2 100644 --- a/tracecmd/trace-cmd.bash +++ b/tracecmd/trace-cmd.bash @@ -84,6 +84,12 @@ __trace_cmd_list_complete() sed -e 's/.*\(-.\).*/\1/') COMPREPLY=( $(compgen -W "${cmds}" -- "${cur}") ) ;; + -e) + local list=$(trace-cmd list -e "$cur") + local events=$(for e in $list; do echo ${e/*:/}; done | sort -u) + local systems=$(for s in $list; do echo ${s/:*/:}; done | sort -u) + COMPREPLY=( $(compgen -W "all ${events} ${systems}" -- "${cur}") ) + ;; *) size=${#words[@]} if [ $size -gt 3 ]; then