From 5698ce03be83d9ac56ca2b57e566bbe88692f5d5 Mon Sep 17 00:00:00 2001 From: Anna Shaleva Date: Mon, 3 Oct 2022 15:05:40 +0300 Subject: [PATCH] cli: move debug flag to options package --- cli/options/options.go | 6 ++++++ cli/server/server.go | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/cli/options/options.go b/cli/options/options.go index 8d6b5a4eb..b2bcedc13 100644 --- a/cli/options/options.go +++ b/cli/options/options.go @@ -59,6 +59,12 @@ var Config = cli.StringFlag{ Usage: "path to directory with configuration files", } +// Debug is a flag for commands that allow node in debug mode usage. +var Debug = cli.BoolFlag{ + Name: "debug, d", + Usage: "enable debug logging (LOTS of output)", +} + var errNoEndpoint = errors.New("no RPC endpoint specified, use option '--" + RPCEndpointFlag + "' or '-r'") var errInvalidHistoric = errors.New("invalid 'historic' parameter, neither a block number, nor a block/state hash") diff --git a/cli/server/server.go b/cli/server/server.go index 8ae5b8136..88d5ff790 100644 --- a/cli/server/server.go +++ b/cli/server/server.go @@ -47,7 +47,7 @@ func NewCommands() []cli.Command { cfgFlags = append(cfgFlags, options.Network...) var cfgWithCountFlags = make([]cli.Flag, len(cfgFlags)) copy(cfgWithCountFlags, cfgFlags) - cfgFlags = append(cfgFlags, cli.BoolFlag{Name: "debug, d", Usage: "enable debug logging (LOTS of output)"}) + cfgFlags = append(cfgFlags, options.Debug) cfgWithCountFlags = append(cfgWithCountFlags, cli.UintFlag{