diff --git a/trace/http.go b/trace/http.go index 2f2a065..0624922 100644 --- a/trace/http.go +++ b/trace/http.go @@ -12,6 +12,9 @@ import ( "fmt" "net/http/httptrace" "net/textproto" + "os" + "os/exec" + "strings" "github.com/rs/zerolog/log" ) @@ -117,3 +120,8 @@ func HTTP(ctx context.Context) context.Context { }, }) } + +// Cmd prints the executed command to stdout. +func Cmd(cmd *exec.Cmd) { + fmt.Fprintf(os.Stdout, "+ %s\n", strings.Join(cmd.Args, " ")) +}