Skip to content

Commit

Permalink
Add support for selecting a default value on a Confirm() box.
Browse files Browse the repository at this point in the history
  • Loading branch information
Alexandre Bourget committed Sep 12, 2024
1 parent a2fbe8e commit 09bbdf4
Show file tree
Hide file tree
Showing 3 changed files with 160 additions and 89 deletions.
3 changes: 3 additions & 0 deletions cmd/substreams/init.go
Original file line number Diff line number Diff line change
Expand Up @@ -387,6 +387,9 @@ func runSubstreamsInitE(cmd *cobra.Command, args []string) error {
input := msg.Confirm

var returnValue bool
if msg.Confirm.DefaultButton == pbconvo.SystemOutput_Confirm_CONFIRM {
returnValue = true
}
inputField := huh.NewConfirm().
Title(input.Prompt).
Affirmative(input.AcceptButtonLabel).
Expand Down
Loading

0 comments on commit 09bbdf4

Please sign in to comment.