From 2bd4ad39286c38f69fdd5441f8463649b290a8ec Mon Sep 17 00:00:00 2001 From: Jaynti Kanani Date: Wed, 18 Nov 2020 17:56:09 +0530 Subject: [PATCH] chg: changes for import/export command --- cmd/geth/chaincmd.go | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/cmd/geth/chaincmd.go b/cmd/geth/chaincmd.go index 788d10ae95db..e9a24412e162 100644 --- a/cmd/geth/chaincmd.go +++ b/cmd/geth/chaincmd.go @@ -274,7 +274,7 @@ func dumpGenesis(ctx *cli.Context) error { } func importChain(ctx *cli.Context) error { - if len(ctx.Args()) < 1 { + if len(ctx.Args()) < 2 { utils.Fatalf("This command requires an argument.") } // Start metrics export if enabled @@ -308,13 +308,14 @@ func importChain(ctx *cli.Context) error { var importErr error - if len(ctx.Args()) == 1 { + // ArgsUsage: " ( ... ) ", + if len(ctx.Args()) == 2 { if err := utils.ImportChain(chain, ctx.Args().First()); err != nil { importErr = err log.Error("Import error", "err", err) } } else { - for _, arg := range ctx.Args() { + for _, arg := range ctx.Args()[:len(ctx.Args())-1] { if err := utils.ImportChain(chain, arg); err != nil { importErr = err log.Error("Import error", "file", arg, "err", err)