From ae52b7bb980be7b5ed3f8fa7d970f5a3b1665dbd Mon Sep 17 00:00:00 2001 From: Andrew Minkin Date: Mon, 16 Oct 2023 13:46:46 +0600 Subject: [PATCH] Revert "EVEREST-488 Added json output" This reverts commit 57cb04d2455a316c38e910cca2441462abfeb9c2. --- commands/version.go | 17 ++--------------- pkg/version/version.go | 12 ------------ 2 files changed, 2 insertions(+), 27 deletions(-) diff --git a/commands/version.go b/commands/version.go index 51de3147..fabf8666 100644 --- a/commands/version.go +++ b/commands/version.go @@ -9,24 +9,11 @@ import ( "github.com/percona/percona-everest-cli/pkg/version" ) -func newVersionCmd(l *zap.SugaredLogger) *cobra.Command { +func newVersionCmd(_ *zap.SugaredLogger) *cobra.Command { return &cobra.Command{ Use: "version", Run: func(cmd *cobra.Command, args []string) { - outputJSON, err := cmd.Flags().GetBool("json") - if err != nil { - l.Errorf("could not parse json global flag. Error: %s", err) - return - } - if !outputJSON { - fmt.Println(version.FullVersionInfo()) //nolint:forbidigo - } - version, err := version.FullVersionJSON() - if err != nil { - l.Errorf("could not print JSON. Error: %s", err) - } - fmt.Println(version) //nolint:forbidigo - + fmt.Println(version.FullVersionInfo()) //nolint:forbidigo }, } } diff --git a/pkg/version/version.go b/pkg/version/version.go index 7597c225..ee41bdbc 100644 --- a/pkg/version/version.go +++ b/pkg/version/version.go @@ -18,7 +18,6 @@ package version import ( - "encoding/json" "fmt" "strings" ) @@ -60,14 +59,3 @@ func FullVersionInfo() string { } return strings.Join(out, "\n") } - -// FullVersionJSON returns version info as JSON -func FullVersionJSON() (string, error) { - res := map[string]string{ - "projectName": ProjectName, - "version": Version, - "fullCommit": FullCommit, - } - data, err := json.Marshal(res) - return string(data), err -}