Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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).
Expand Down
1 change: 1 addition & 0 deletions cmd/run.go
Original file line number Diff line number Diff line change
Expand Up @@ -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")
}
Expand Down
11 changes: 7 additions & 4 deletions cmd/submit.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,10 @@ import (
)

var (
forceSubmit bool
debugSubmission bool
verboseOutput bool
forceSubmit bool
skipSubmitConfirmation bool
debugSubmission bool
verboseOutput bool
)

func init() {
Expand Down Expand Up @@ -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?",
Expand Down