refactor: remove cometbft/libs/cli import (#15673)
This commit is contained in:
+6
-4
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user