refactor(cli): Standardize Use field convention and update readme (#21369)

This commit is contained in:
Lucas Francisco López
2024-08-21 08:36:34 +00:00
committed by GitHub
parent 95dcf845c3
commit bdb9232ed8
56 changed files with 200 additions and 173 deletions
+2 -2
View File
@@ -20,7 +20,7 @@ import (
// SetCommand returns a CLI command to interactively update an application config value.
func SetCommand() *cobra.Command {
cmd := &cobra.Command{
Use: "set [config] [key] [value]",
Use: "set <config> <key> <value>",
Short: "Set an application config value",
Long: "Set an application config value. The [config] argument must be the path of the file when using the `confix` tool standalone, otherwise it must be the name of the config file without the .toml extension.",
Args: cobra.ExactArgs(3),
@@ -92,7 +92,7 @@ func SetCommand() *cobra.Command {
// GetCommand returns a CLI command to interactively get an application config value.
func GetCommand() *cobra.Command {
cmd := &cobra.Command{
Use: "get [config] [key]",
Use: "get <config> <key>",
Short: "Get an application config value",
Long: "Get an application config value. The [config] argument must be the path of the file when using the `confix` tool standalone, otherwise it must be the name of the config file without the .toml extension.",
Args: cobra.ExactArgs(2),
+1 -1
View File
@@ -16,7 +16,7 @@ func ViewCommand() *cobra.Command {
flagOutputFormat := "output-format"
cmd := &cobra.Command{
Use: "view [config]",
Use: "view <config>",
Short: "View the config file",
Long: "View the config file. The [config] argument must be the path of the file when using the `confix` tool standalone, otherwise it must be the name of the config file without the .toml extension.",
Args: cobra.ExactArgs(1),
@@ -15,7 +15,7 @@ import (
func NewAddUpgradeCmd() *cobra.Command {
addUpgrade := &cobra.Command{
Use: "add-upgrade [upgrade-name] [path to executable]",
Use: "add-upgrade <upgrade-name> <path to executable>",
Short: "Add APP upgrade binary to cosmovisor",
SilenceUsage: true,
Args: cobra.ExactArgs(2),
@@ -20,7 +20,7 @@ func TestVersionCommand_Error(t *testing.T) {
rootCmd.SetOut(out)
rootCmd.SetErr(out)
ctx := context.WithValue(context.Background(), log.ContextKey, logger) //nolint:staticcheck // temporary issue in dependency
ctx := context.WithValue(context.Background(), log.ContextKey, logger) //nolint:staticcheck // SA1029: temporary issue in dependency
require.Error(t, rootCmd.ExecuteContext(ctx))
require.Contains(t, out.String(), "DAEMON_NAME is not set")
+1 -1
View File
@@ -25,7 +25,7 @@ func InitCmd(config *config.Config, configDir string) *cobra.Command {
var insecure bool
cmd := &cobra.Command{
Use: "init [foochain]",
Use: "init <foochain>",
Short: "Initialize a new chain",
Long: `To configure a new chain, run this command using the --init flag and the name of the chain as it's listed in the chain registry (https://github.com/cosmos/chain-registry).
If the chain is not listed in the chain registry, you can use any unique name.`,