rename flag to very verbose.

This commit is contained in:
Raúl Kripalani 2021-07-27 20:46:02 +01:00
parent 3451acbc03
commit b04fb75a92
6 changed files with 18 additions and 18 deletions

View File

@ -146,7 +146,7 @@ func GetRawAPI(ctx *cli.Context, t repo.RepoType, version string) (string, http.
return "", nil, xerrors.Errorf("could not get DialArgs: %w", err) return "", nil, xerrors.Errorf("could not get DialArgs: %w", err)
} }
if IsSuperVerbose { if IsVeryVerbose {
_, _ = fmt.Fprintf(ctx.App.Writer, "using raw API %s endpoint: %s\n", version, addr) _, _ = fmt.Fprintf(ctx.App.Writer, "using raw API %s endpoint: %s\n", version, addr)
} }
@ -189,7 +189,7 @@ func GetFullNodeAPI(ctx *cli.Context) (v0api.FullNode, jsonrpc.ClientCloser, err
return nil, nil, err return nil, nil, err
} }
if IsSuperVerbose { if IsVeryVerbose {
_, _ = fmt.Fprintln(ctx.App.Writer, "using full node API v0 endpoint:", addr) _, _ = fmt.Fprintln(ctx.App.Writer, "using full node API v0 endpoint:", addr)
} }
@ -206,7 +206,7 @@ func GetFullNodeAPIV1(ctx *cli.Context) (v1api.FullNode, jsonrpc.ClientCloser, e
return nil, nil, err return nil, nil, err
} }
if IsSuperVerbose { if IsVeryVerbose {
_, _ = fmt.Fprintln(ctx.App.Writer, "using full node API v1 endpoint:", addr) _, _ = fmt.Fprintln(ctx.App.Writer, "using full node API v1 endpoint:", addr)
} }
@ -254,7 +254,7 @@ func GetStorageMinerAPI(ctx *cli.Context, opts ...GetStorageMinerOption) (api.St
addr = u.String() addr = u.String()
} }
if IsSuperVerbose { if IsVeryVerbose {
_, _ = fmt.Fprintln(ctx.App.Writer, "using miner API v0 endpoint:", addr) _, _ = fmt.Fprintln(ctx.App.Writer, "using miner API v0 endpoint:", addr)
} }
@ -267,7 +267,7 @@ func GetWorkerAPI(ctx *cli.Context) (api.Worker, jsonrpc.ClientCloser, error) {
return nil, nil, err return nil, nil, err
} }
if IsSuperVerbose { if IsVeryVerbose {
_, _ = fmt.Fprintln(ctx.App.Writer, "using worker API v0 endpoint:", addr) _, _ = fmt.Fprintln(ctx.App.Writer, "using worker API v0 endpoint:", addr)
} }
@ -280,7 +280,7 @@ func GetGatewayAPI(ctx *cli.Context) (api.Gateway, jsonrpc.ClientCloser, error)
return nil, nil, err return nil, nil, err
} }
if IsSuperVerbose { if IsVeryVerbose {
_, _ = fmt.Fprintln(ctx.App.Writer, "using gateway API v1 endpoint:", addr) _, _ = fmt.Fprintln(ctx.App.Writer, "using gateway API v1 endpoint:", addr)
} }
@ -293,7 +293,7 @@ func GetGatewayAPIV0(ctx *cli.Context) (v0api.Gateway, jsonrpc.ClientCloser, err
return nil, nil, err return nil, nil, err
} }
if IsSuperVerbose { if IsVeryVerbose {
_, _ = fmt.Fprintln(ctx.App.Writer, "using gateway API v0 endpoint:", addr) _, _ = fmt.Fprintln(ctx.App.Writer, "using gateway API v0 endpoint:", addr)
} }

View File

@ -2,15 +2,15 @@ package cliutil
import "github.com/urfave/cli/v2" import "github.com/urfave/cli/v2"
// IsSuperVerbose is a global var signalling if we're running in super verbose // IsVeryVerbose is a global var signalling if the CLI is running in very
// mode or not (default: false). // verbose mode or not (default: false).
var IsSuperVerbose bool var IsVeryVerbose bool
// FlagSuperVerbose enables super verbose mode, which is useful when debugging // FlagVeryVerbose enables very verbose mode, which is useful when debugging
// the CLI itself. It should be included as a flag on the top-level command // the CLI itself. It should be included as a flag on the top-level command
// (e.g. lotus -vv, lotus-miner -vv). // (e.g. lotus -vv, lotus-miner -vv).
var FlagSuperVerbose = &cli.BoolFlag{ var FlagVeryVerbose = &cli.BoolFlag{
Name: "vv", Name: "vv",
Usage: "enables super verbose mode, useful for debugging the CLI", Usage: "enables very verbose mode, useful for debugging the CLI",
Destination: &IsSuperVerbose, Destination: &IsVeryVerbose,
} }

View File

@ -106,7 +106,7 @@ func main() {
Value: "~/.lotusminer", // TODO: Consider XDG_DATA_HOME Value: "~/.lotusminer", // TODO: Consider XDG_DATA_HOME
Usage: fmt.Sprintf("Specify miner repo path. flag(%s) and env(LOTUS_STORAGE_PATH) are DEPRECATION, will REMOVE SOON", FlagMinerRepoDeprecation), Usage: fmt.Sprintf("Specify miner repo path. flag(%s) and env(LOTUS_STORAGE_PATH) are DEPRECATION, will REMOVE SOON", FlagMinerRepoDeprecation),
}, },
cliutil.FlagSuperVerbose, cliutil.FlagVeryVerbose,
}, },
Commands: append(local, lcli.CommonCommands...), Commands: append(local, lcli.CommonCommands...),

View File

@ -82,7 +82,7 @@ func main() {
Name: "force-send", Name: "force-send",
Usage: "if true, will ignore pre-send checks", Usage: "if true, will ignore pre-send checks",
}, },
cliutil.FlagSuperVerbose, cliutil.FlagVeryVerbose,
}, },
Commands: append(local, lcli.Commands...), Commands: append(local, lcli.Commands...),

View File

@ -43,7 +43,7 @@ GLOBAL OPTIONS:
--actor value, -a value specify other actor to check state for (read only) --actor value, -a value specify other actor to check state for (read only)
--color use color in display output (default: depends on output being a TTY) --color use color in display output (default: depends on output being a TTY)
--miner-repo value, --storagerepo value Specify miner repo path. flag(storagerepo) and env(LOTUS_STORAGE_PATH) are DEPRECATION, will REMOVE SOON (default: "~/.lotusminer") [$LOTUS_MINER_PATH, $LOTUS_STORAGE_PATH] --miner-repo value, --storagerepo value Specify miner repo path. flag(storagerepo) and env(LOTUS_STORAGE_PATH) are DEPRECATION, will REMOVE SOON (default: "~/.lotusminer") [$LOTUS_MINER_PATH, $LOTUS_STORAGE_PATH]
--vv enables super verbose mode, useful for debugging the CLI (default: false) --vv enables very verbose mode, useful for debugging the CLI (default: false)
--help, -h show help (default: false) --help, -h show help (default: false)
--version, -v print the version (default: false) --version, -v print the version (default: false)
``` ```

View File

@ -39,7 +39,7 @@ COMMANDS:
GLOBAL OPTIONS: GLOBAL OPTIONS:
--interactive setting to false will disable interactive functionality of commands (default: false) --interactive setting to false will disable interactive functionality of commands (default: false)
--force-send if true, will ignore pre-send checks (default: false) --force-send if true, will ignore pre-send checks (default: false)
--vv enables super verbose mode, useful for debugging the CLI (default: false) --vv enables very verbose mode, useful for debugging the CLI (default: false)
--help, -h show help (default: false) --help, -h show help (default: false)
--version, -v print the version (default: false) --version, -v print the version (default: false)
``` ```