From cd6681585446f990a8e625c48aa0dc26c211d403 Mon Sep 17 00:00:00 2001 From: Leo Di Donato Date: Thu, 10 Oct 2019 18:31:51 +0200 Subject: [PATCH] fix: set our and err writers to errout persistently Signed-off-by: Leonardo Di Donato --- pkg/cmd/trace.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pkg/cmd/trace.go b/pkg/cmd/trace.go index 04d72acf..e7ac0aa7 100644 --- a/pkg/cmd/trace.go +++ b/pkg/cmd/trace.go @@ -52,8 +52,10 @@ func NewTraceCommand(streams genericclioptions.IOStreams) *cobra.Command { Short: `Execute and manage bpftrace programs`, // Wrap with i18n.T() Long: traceLong, // Wrap with templates.LongDesc() Example: fmt.Sprintf(traceExamples, "kubectl"), // Wrap with templates.Examples() - Run: func(c *cobra.Command, args []string) { + PersistentPreRun: func(c *cobra.Command, args []string) { c.SetOutput(streams.ErrOut) + }, + Run: func(c *cobra.Command, args []string) { cobra.NoArgs(c, args) c.Help() },