diff --git a/cli/wallet/wallet.go b/cli/wallet/wallet.go index 95d97bf32..ecb30072e 100644 --- a/cli/wallet/wallet.go +++ b/cli/wallet/wallet.go @@ -193,11 +193,15 @@ func NewCommands() []cli.Command { { Name: "import-deployed", Usage: "import deployed contract", - UsageText: "import-deployed --wallet --wif --contract ", + UsageText: "import-deployed --wallet --wif --contract [--name ]", Action: importDeployed, Flags: append([]cli.Flag{ walletPathFlag, wifFlag, + cli.StringFlag{ + Name: "name, n", + Usage: "Optional account name", + }, flags.AddressFlag{ Name: "contract, c", Usage: "Contract hash or address", @@ -466,6 +470,9 @@ func importDeployed(ctx *cli.Context) error { } acc.Contract.Deployed = true + if acc.Label == "" { + acc.Label = ctx.String("name") + } if err := addAccountAndSave(wall, acc); err != nil { return cli.NewExitError(err, 1) }