refactor: remove cometbft/libs/cli import (#15673)

This commit is contained in:
Julien Robert
2023-04-03 14:48:02 +00:00
committed by GitHub
parent f69fdad424
commit c1974e4b3c
21 changed files with 72 additions and 84 deletions
+6 -4
View File
@@ -5,12 +5,14 @@ import (
"fmt"
"strings"
"github.com/cometbft/cometbft/libs/cli"
"github.com/spf13/cobra"
"sigs.k8s.io/yaml"
)
const flagLong = "long"
const (
flagLong = "long"
flagOutput = "output"
)
// NewVersionCommand returns a CLI command to interactively print the application binary version information.
func NewVersionCommand() *cobra.Command {
@@ -31,7 +33,7 @@ func NewVersionCommand() *cobra.Command {
err error
)
output, _ := cmd.Flags().GetString(cli.OutputFlag)
output, _ := cmd.Flags().GetString(flagOutput)
switch strings.ToLower(output) {
case "json":
bz, err = json.Marshal(verInfo)
@@ -50,7 +52,7 @@ func NewVersionCommand() *cobra.Command {
}
cmd.Flags().Bool(flagLong, false, "Print long version information")
cmd.Flags().StringP(cli.OutputFlag, "o", "text", "Output format (text|json)")
cmd.Flags().StringP(flagOutput, "o", "text", "Output format (text|json)")
return cmd
}