mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-07-05 04:54:59 +02:00
lncli: option to skip prompts for loadmc
This makes the command scriptable.
This commit is contained in:
@ -133,6 +133,11 @@ var loadMissionControlCommand = cli.Command{
|
||||
"results in the database with older results " +
|
||||
"from the file.",
|
||||
},
|
||||
cli.BoolFlag{
|
||||
Name: "skip_confirmation",
|
||||
Usage: "Skip the confirmation prompt and import " +
|
||||
"immediately",
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
@ -209,7 +214,11 @@ func loadMissionControl(ctx *cli.Context) error {
|
||||
sanitizeMCData(mc.Pairs)
|
||||
|
||||
fmt.Printf("Mission control file contains %v pairs.\n", len(mc.Pairs))
|
||||
if !promptForConfirmation("Import mission control data (yes/no): ") {
|
||||
if !ctx.Bool("skip_confirmation") &&
|
||||
!promptForConfirmation(
|
||||
"Import mission control data (yes/no): ",
|
||||
) {
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user