Skip to content

Default -r confirmation to yes (Enter runs the command) - #4

Merged
emarref merged 2 commits into
mainfrom
1-run-mode-default-yes
Jul 27, 2026
Merged

Default -r confirmation to yes (Enter runs the command)#4
emarref merged 2 commits into
mainfrom
1-run-mode-default-yes

Conversation

@emarref

@emarref emarref commented Jul 27, 2026

Copy link
Copy Markdown
Owner

Closes #1.

What

In -r / --run mode the confirmation prompt now defaults to yes:

  • Enter (or y / yes) runs the command
  • n / no — or anything unrecognised — aborts (exit 0)
  • e / edit still edits before running (an empty edit aborts)
  • Prompt is now Run this? [Y/n/e to edit]

How

  • Extracted the pure answer→decision logic into a new MaicCore library (runConfirmation(for:) + a RunConfirmation enum) so it's unit-testable, with the CLI's interactive I/O kept thin around it.
  • Added a swift run maicTests harness (14 checks covering every answer-mapping acceptance criterion). A plain executable rather than a testTarget because swift test needs full Xcode; this runs under Command Line Tools and CI alike.
  • Wired the tests into both ci.yml (push/PR) and release.yml (so a test regression fails a release).
  • Updated --help and the README to describe the new default.

Review

Ran a two-axis review (standards + spec). Standards: clean. Spec: caught that --help hadn'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--r path, no change to model output.

emarref added 2 commits July 27, 2026 18:11
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
@emarref
emarref merged commit 71404a3 into main Jul 27, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Make 'yes' the default when confirming a command in -r (run) mode

1 participant