Skip to content

feat: pass --quiet and --no-color flags through ez watch#1606

Merged
SchoolyB merged 1 commit intoSchoolyB:devfrom
mvanhorn:osc/1573-add-quiet-no-color-flags-watch
May 4, 2026
Merged

feat: pass --quiet and --no-color flags through ez watch#1606
SchoolyB merged 1 commit intoSchoolyB:devfrom
mvanhorn:osc/1573-add-quiet-no-color-flags-watch

Conversation

@mvanhorn
Copy link
Copy Markdown
Contributor

@mvanhorn mvanhorn commented May 3, 2026

Summary

ez watch re-runs the compiler on file changes but didn't accept --quiet or --no-color, unlike ez build and ez check. This PR adds both flags to watchCmd and passes them through to each ezc.Run invocation, mirroring the existing pattern in buildCmd.

What changed

  • cmd/ez/commands.go — register --quiet/-q (string) and --no-color (bool) on watchCmd (mirror of the existing buildCmd/checkCmd registrations a few lines above).
  • cmd/ez/watch.go — in runWatch, build a compilerArgs []string from cmd.Flags() using the same if quiet == "all" / else if quiet != "" / noColor shape as buildCmd (commands.go:440-450). Plumb the slice through watchFile, watchDirectory, and executeFile so each rerun calls ezc.Run(filename, compilerArgs) instead of ezc.Run(filename, nil).

23 lines added, 10 removed across two files.

Verification

  • go build ./... and go vet ./... pass.
  • make test — 907/907 passing.
  • Manual smoke with a stub ezc confirms the slice reaches the compiler:
    • ez watch foo.ez --no-colorrun foo.ez --no-color
    • ez watch foo.ez -q W1001run foo.ez --quiet W1001
    • ez watch foo.ez -q allrun foo.ez --quiet
    • ez watch foo.ezrun foo.ez (nil args, unchanged behavior)

Closes #1573

This contribution was developed with AI assistance.

Adds --quiet/-q and --no-color flag support to ez watch, mirroring the
pattern already used by ez build and ez check (cmd/ez/commands.go:440-450).

In runWatch, build a compilerArgs slice from cmd.Flags() and plumb it
through watchFile, watchDirectory, and executeFile so each compiler
invocation on file changes receives the same flags.

Closes SchoolyB#1573
@SchoolyB SchoolyB added PR: In Review This PR is being reviewed PR: Ready This PR is ready pull request is ready to merge and removed PR: In Review This PR is being reviewed labels May 4, 2026
@SchoolyB SchoolyB changed the base branch from main to dev May 4, 2026 13:37
@SchoolyB SchoolyB merged commit e35016e into SchoolyB:dev May 4, 2026
5 of 6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

PR: Ready This PR is ready pull request is ready to merge

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat: pass --quiet and --no-color flags through ez watch

2 participants