Default -r confirmation to yes (Enter runs the command) - #4
Merged
Conversation
In -r/--run mode the confirmation prompt now defaults to yes: pressing Enter (or y/yes) runs the command, n/no or anything unrecognised aborts, and e/edit still edits first. Prompt is now [Y/n/e to edit]. Extracts the pure answer->decision logic into a new MaicCore library (runConfirmation(for:)) so it is unit-testable, adds a swift-run test harness (swift test needs full Xcode; this runs under Command Line Tools and CI alike), wires it into CI, and updates --help and the README. Closes #1
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Closes #1.
What
In
-r/--runmode the confirmation prompt now defaults to yes:y/yes) runs the commandn/no— or anything unrecognised — aborts (exit 0)e/editstill edits before running (an empty edit aborts)Run this? [Y/n/e to edit]How
MaicCorelibrary (runConfirmation(for:)+ aRunConfirmationenum) so it's unit-testable, with the CLI's interactive I/O kept thin around it.swift run maicTestsharness (14 checks covering every answer-mapping acceptance criterion). A plain executable rather than atestTargetbecauseswift testneeds full Xcode; this runs under Command Line Tools and CI alike.ci.yml(push/PR) andrelease.yml(so a test regression fails a release).--helpand the README to describe the new default.Review
Ran a two-axis review (standards + spec). Standards: clean. Spec: caught that
--helphadn't been updated to advertise the new default — fixed before commit.Out of scope (unchanged, per the ticket): no
--yes/non-interactive flag, no change to the non--rpath, no change to model output.