cli: change name for wallet path flag

`-p` is used for `--privnet`, `-w` is for wallet.
Fix CLI error:
balance flag redefined: p
panic: balance flag redefined: p
This commit is contained in:
Evgenii Stratonikov 2020-06-25 10:34:02 +03:00
parent 3d6ff3559e
commit 65cb6dd0ad
4 changed files with 14 additions and 14 deletions

View file

@ -27,7 +27,7 @@ func newMultisigCommands() []cli.Command {
{
Name: "sign",
Usage: "sign a transaction",
UsageText: "multisig sign --path <path> --addr <addr> --in <file.in> --out <file.out>",
UsageText: "multisig sign --wallet <path> --addr <addr> --in <file.in> --out <file.out>",
Action: signMultisig,
Flags: signFlags,
},

View file

@ -60,21 +60,21 @@ func newNEP5Commands() []cli.Command {
{
Name: "balance",
Usage: "get address balance",
UsageText: "balance --path <path> --rpc-endpoint <node> --timeout <time> --addr <addr> [--token <hash-or-name>]",
UsageText: "balance --wallet <path> --rpc-endpoint <node> --timeout <time> --addr <addr> [--token <hash-or-name>]",
Action: getNEP5Balance,
Flags: balanceFlags,
},
{
Name: "import",
Usage: "import NEP5 token to a wallet",
UsageText: "import --path <path> --rpc-endpoint <node> --timeout <time> --token <hash>",
UsageText: "import --wallet <path> --rpc-endpoint <node> --timeout <time> --token <hash>",
Action: importNEP5Token,
Flags: importFlags,
},
{
Name: "info",
Usage: "print imported NEP5 token info",
UsageText: "print --path <path> [--token <hash-or-name>]",
UsageText: "print --wallet <path> [--token <hash-or-name>]",
Action: printNEP5Info,
Flags: []cli.Flag{
walletPathFlag,
@ -87,7 +87,7 @@ func newNEP5Commands() []cli.Command {
{
Name: "remove",
Usage: "remove NEP5 token from the wallet",
UsageText: "remove --path <path> <hash-or-name>",
UsageText: "remove --wallet <path> <hash-or-name>",
Action: removeNEP5Token,
Flags: []cli.Flag{
walletPathFlag,
@ -101,7 +101,7 @@ func newNEP5Commands() []cli.Command {
{
Name: "transfer",
Usage: "transfer NEP5 tokens",
UsageText: "transfer --path <path> --rpc-endpoint <node> --timeout <time> --from <addr> --to <addr> --token <hash> --amount string",
UsageText: "transfer --wallet <path> --rpc-endpoint <node> --timeout <time> --from <addr> --to <addr> --token <hash> --amount string",
Action: transferNEP5,
Flags: transferFlags,
},

View file

@ -20,13 +20,13 @@ import (
)
var (
errNoPath = errors.New("target path where the wallet should be stored is mandatory and should be passed using (--path, -p) flags")
errNoPath = errors.New("target path where the wallet should be stored is mandatory and should be passed using (--wallet, -w) flags")
errPhraseMismatch = errors.New("the entered pass-phrases do not match. Maybe you have misspelled them")
)
var (
walletPathFlag = cli.StringFlag{
Name: "path, p",
Name: "wallet, w",
Usage: "Target location of the wallet file.",
}
wifFlag = cli.StringFlag{
@ -123,7 +123,7 @@ func NewCommands() []cli.Command {
{
Name: "export",
Usage: "export keys for address",
UsageText: "export --path <path> [--decrypt] [<address>]",
UsageText: "export --wallet <path> [--decrypt] [<address>]",
Action: exportKeys,
Flags: []cli.Flag{
walletPathFlag,
@ -150,7 +150,7 @@ func NewCommands() []cli.Command {
{
Name: "import-multisig",
Usage: "import multisig contract",
UsageText: "import-multisig --path <path> --wif <wif> --min <n>" +
UsageText: "import-multisig --wallet <path> --wif <wif> --min <n>" +
" [<pubkey1> [<pubkey2> [...]]]",
Action: importMultisig,
Flags: []cli.Flag{
@ -169,7 +169,7 @@ func NewCommands() []cli.Command {
{
Name: "remove",
Usage: "remove an account from the wallet",
UsageText: "remove --path <path> [--force] <addr>",
UsageText: "remove --wallet <path> [--force] <addr>",
Action: removeAccount,
Flags: []cli.Flag{
walletPathFlag,

View file

@ -178,6 +178,6 @@ There is a small subset of commands:
## Wallet operations
- `./bin/neo-go wallet init -p newWallet` to create new wallet in the path `newWallet`
- `./bin/neo-go wallet dump -p newWallet` to open created wallet in the path `newWallet`
- `./bin/neo-go wallet init -p newWallet -a` to create new account
- `./bin/neo-go wallet init -w newWallet` to create new wallet in the path `newWallet`
- `./bin/neo-go wallet dump -w newWallet` to open created wallet in the path `newWallet`
- `./bin/neo-go wallet init -w newWallet -a` to create new account