cli: declare wallet path flag once

This commit is contained in:
Evgenii Stratonikov 2020-02-20 12:05:55 +03:00
parent cad1f074d4
commit 02954285c1

View file

@ -18,6 +18,13 @@ var (
errPhraseMismatch = errors.New("the entered pass-phrases do not match. Maybe you have misspelled them") 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. // NewCommands returns 'wallet' command.
func NewCommands() []cli.Command { func NewCommands() []cli.Command {
return []cli.Command{{ return []cli.Command{{
@ -29,10 +36,7 @@ func NewCommands() []cli.Command {
Usage: "create a new wallet", Usage: "create a new wallet",
Action: createWallet, Action: createWallet,
Flags: []cli.Flag{ Flags: []cli.Flag{
cli.StringFlag{ walletPathFlag,
Name: "path, p",
Usage: "Target location of the wallet file.",
},
cli.BoolFlag{ cli.BoolFlag{
Name: "account, a", Name: "account, a",
Usage: "Create a new account", Usage: "Create a new account",
@ -44,10 +48,7 @@ func NewCommands() []cli.Command {
Usage: "check and dump an existing NEO wallet", Usage: "check and dump an existing NEO wallet",
Action: dumpWallet, Action: dumpWallet,
Flags: []cli.Flag{ Flags: []cli.Flag{
cli.StringFlag{ walletPathFlag,
Name: "path, p",
Usage: "Target location of the wallet file.",
},
cli.BoolFlag{ cli.BoolFlag{
Name: "decrypt, d", Name: "decrypt, d",
Usage: "Decrypt encrypted keys.", Usage: "Decrypt encrypted keys.",