From 02954285c1c7cad7f0d290fb2f8837c27d860bf1 Mon Sep 17 00:00:00 2001 From: Evgenii Stratonikov Date: Thu, 20 Feb 2020 12:05:55 +0300 Subject: [PATCH] cli: declare wallet path flag once --- cli/wallet/wallet.go | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/cli/wallet/wallet.go b/cli/wallet/wallet.go index 503508503..f94990d2f 100644 --- a/cli/wallet/wallet.go +++ b/cli/wallet/wallet.go @@ -18,6 +18,13 @@ var ( errPhraseMismatch = errors.New("the entered pass-phrases do not match. Maybe you have misspelled them") ) +var ( + walletPathFlag = cli.StringFlag{ + Name: "path, p", + Usage: "Target location of the wallet file.", + } +) + // NewCommands returns 'wallet' command. func NewCommands() []cli.Command { return []cli.Command{{ @@ -29,10 +36,7 @@ func NewCommands() []cli.Command { Usage: "create a new wallet", Action: createWallet, Flags: []cli.Flag{ - cli.StringFlag{ - Name: "path, p", - Usage: "Target location of the wallet file.", - }, + walletPathFlag, cli.BoolFlag{ Name: "account, a", Usage: "Create a new account", @@ -44,10 +48,7 @@ func NewCommands() []cli.Command { Usage: "check and dump an existing NEO wallet", Action: dumpWallet, Flags: []cli.Flag{ - cli.StringFlag{ - Name: "path, p", - Usage: "Target location of the wallet file.", - }, + walletPathFlag, cli.BoolFlag{ Name: "decrypt, d", Usage: "Decrypt encrypted keys.",