From 53989cc775eec21066eaf79c750d8e57bec649c8 Mon Sep 17 00:00:00 2001 From: Ishaan Date: Tue, 20 Oct 2026 20:39:54 +0530 Subject: [PATCH] add --yes flag to skip next submission confirmation --- README.md | 6 ++++++ cmd/run.go | 1 + cmd/submit.go | 11 +++++++---- 3 files changed, 14 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index d0b27ff..02c65a6 100644 --- a/README.md +++ b/README.md @@ -143,6 +143,12 @@ bootdev run -s bootdev run -s UUID ``` +When submitting the next lesson, the CLI asks for a confirmation. To skip that prompt, use the `--yes` (`-y`) flag: + +```sh +bootdev run -sy +``` + ## Configuration The Boot.dev CLI offers a couple of configuration options that are stored in a config file (default is `~/.bootdev.yaml`, or `$XDG_CONFIG_HOME/bootdev/config.yaml` if `XDG_CONFIG_HOME` is set). diff --git a/cmd/run.go b/cmd/run.go index c54e89d..1ee1d3b 100644 --- a/cmd/run.go +++ b/cmd/run.go @@ -7,6 +7,7 @@ import ( func init() { rootCmd.AddCommand(runCmd) runCmd.Flags().BoolVarP(&forceSubmit, "submit", "s", false, "shortcut flag to submit after running") + runCmd.Flags().BoolVarP(&skipSubmitConfirmation, "yes", "y", false, "with --submit, skip the lesson confirmation prompt") runCmd.Flags().BoolVar(&debugSubmission, "debug", false, "log submission request/response debug output") runCmd.Flags().BoolVarP(&verboseOutput, "verbose", "v", false, "with --submit, show detailed final output for every step") } diff --git a/cmd/submit.go b/cmd/submit.go index 6aca1c2..9b6999a 100644 --- a/cmd/submit.go +++ b/cmd/submit.go @@ -17,9 +17,10 @@ import ( ) var ( - forceSubmit bool - debugSubmission bool - verboseOutput bool + forceSubmit bool + skipSubmitConfirmation bool + debugSubmission bool + verboseOutput bool ) func init() { @@ -51,7 +52,9 @@ func submissionHandler(cmd *cobra.Command, args []string) error { } lessonLabel := fmt.Sprintf("%d.%d - %s", nextLesson.ChapterNumber, nextLesson.LessonNumber, nextLesson.LessonTitle) if isSubmit { - if !promptToContinue( + if skipSubmitConfirmation { + fmt.Printf("Submitting next lesson:\n%s\n", lessonLabel) + } else if !promptToContinue( "Submitting next lesson:", lessonLabel, "Continue?",