Skip to content
This repository has been archived by the owner on Mar 4, 2024. It is now read-only.

Commit

Permalink
Revert "EVEREST-488 Added json output"
Browse files Browse the repository at this point in the history
This reverts commit 57cb04d.
  • Loading branch information
gen1us2k committed Oct 16, 2023
1 parent 57cb04d commit ae52b7b
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 27 deletions.
17 changes: 2 additions & 15 deletions commands/version.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
},
}
}
12 changes: 0 additions & 12 deletions pkg/version/version.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
package version

import (
"encoding/json"
"fmt"
"strings"
)
Expand Down Expand Up @@ -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
}

0 comments on commit ae52b7b

Please sign in to comment.