lncli: option to skip prompts for loadmc

This makes the command scriptable.
This commit is contained in:
bitromortac
2025-05-06 10:18:39 +02:00
parent 725a80a3b7
commit d33c92bd19

View File

@ -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
}