-
Notifications
You must be signed in to change notification settings - Fork 10
fix(wizard): pass --default=no so default_no prompts actually preselect No #100
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
With Gum v0.14.5,
--defaultis a boolean whose explicit value is decoded through Kong’sstrconv.ParseBoolmapper; the Go documentation lists accepted false values as0,f, andfalse, notno. Consequently--default=nois rejected before the TUI opens, and the surrounding|| rc=$?silently converts that parse failure into a negative answer. During interactive installs, every default-no prompt—including Cognito, Telegram, AWS CLI updates, quota requests, and some continue/abort paths—therefore becomes impossible to accept; pass--default=falseinstead.Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks — but this is a false positive, and gum's own error message is the disproof.
Gum does not use Kong's stock
strconv.ParseBoolmapper for this flag; it registers a custom bool mapper. Feeding it a value that mapper rejects makes it enumerate exactly what it accepts:So the accepted set is
true, 1, yes, false, 0, no—yesandnoare valid, whiletandfare the values that get rejected. That is the inverse of whatstrconv.ParseBoolwould do, which is what makes the ParseBool premise identifiable as the wrong model here.Probed across the full range on gum v0.14.5 (
linux/arm64), capturing stderr:nofalse0yestrue1ftTwo further points against the finding as written:
yes/nowere rejected, the pre-existing--default=yeson the affirmative branch — untouched by this PR and shipping for many releases — would have been silently broken the whole time, turning everydefault_yesprompt negative. That has not been observed.rcreflects the user's real choice.--default=falsewould also work and is equivalent; I'm keepingnobecause it reads symmetrically against the existing--default=yeson the adjacent branch. No code change.Note the exit code alone cannot settle this:
gum confirmreturns 1 for every flag combination when it has no TTY, so a non-interactive exit-code probe is not valid evidence. The parse error on stderr is, because argument parsing happens before the TUI opens.