From d33c92bd19c742870c342f256e71e6e316eed356 Mon Sep 17 00:00:00 2001 From: bitromortac Date: Tue, 6 May 2025 10:18:39 +0200 Subject: [PATCH] lncli: option to skip prompts for loadmc This makes the command scriptable. --- cmd/commands/cmd_import_mission_control.go | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/cmd/commands/cmd_import_mission_control.go b/cmd/commands/cmd_import_mission_control.go index 3159d551f..1fb63c859 100644 --- a/cmd/commands/cmd_import_mission_control.go +++ b/cmd/commands/cmd_import_mission_control.go @@ -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 }