Skip to content

Commit

Permalink
fix deprecation flag printing to stdout
Browse files Browse the repository at this point in the history
Signed-off-by: Alex Goodman <wagoodman@users.noreply.github.com>
  • Loading branch information
wagoodman committed Dec 16, 2023
1 parent 63c23e2 commit 2550e62
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions cmd/syft/cli/cli.go
Original file line number Diff line number Diff line change
Expand Up @@ -91,8 +91,10 @@ func create(id clio.Identification, out io.Writer) (clio.Application, *cobra.Com
cranecmd.NewCmdAuthLogin(id.Name), // syft login uses the same command as crane
)

// explicitly set Cobra output to the real stdout to write things like errors and help
rootCmd.SetOut(out)
// note: we would direct cobra to use our writer explicitly with rootCmd.SetOut(out) , however this causes
// deprecation warnings to be shown to stdout via the writer instead of stderr. This is unfortunate since this
// does not appear to be the correct behavior on cobra's part https://github.com/spf13/cobra/issues/1708 .
// In the future this functionality should be restored.

return app, rootCmd
}

0 comments on commit 2550e62

Please sign in to comment.