From f1e91313db4d6327ae7e72a91f3829a3cc3b0f3a Mon Sep 17 00:00:00 2001 From: Evgenii Stratonikov Date: Tue, 12 Apr 2022 11:23:14 +0300 Subject: [PATCH] [#1311] neofs-adm: Set stdout as default output Cobra `Command` prints to stderr by default. `neofs-cli` already sets the output properly. Signed-off-by: Evgenii Stratonikov --- cmd/neofs-adm/internal/modules/root.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/cmd/neofs-adm/internal/modules/root.go b/cmd/neofs-adm/internal/modules/root.go index 10389c8f80..4322e6c701 100644 --- a/cmd/neofs-adm/internal/modules/root.go +++ b/cmd/neofs-adm/internal/modules/root.go @@ -2,6 +2,7 @@ package modules import ( "fmt" + "os" "github.com/nspcc-dev/neofs-node/cmd/neofs-adm/internal/modules/config" "github.com/nspcc-dev/neofs-node/cmd/neofs-adm/internal/modules/morph" @@ -30,6 +31,9 @@ func init() { // we need to init viper config to bind viper and cobra configurations for // rpc endpoint, alphabet wallet dir, key credentials, etc. + // use stdout as default output for cmd.Print() + rootCmd.SetOut(os.Stdout) + rootCmd.PersistentFlags().StringP(configFlag, "c", "", "config file") rootCmd.Flags().Bool("version", false, "application version")