mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-27 23:26:44 +00:00
chg: changes for import/export command
This commit is contained in:
parent
8c7cf1d64f
commit
2bd4ad3928
1 changed files with 4 additions and 3 deletions
|
|
@ -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: "<filename> (<filename 2> ... <filename N>) <genesisPath>",
|
||||
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)
|
||||
|
|
|
|||
Loading…
Reference in a new issue