Skip to content

feat: add @ prefix to suppress command echoing (Issue #6)#40

Merged
seanseannery merged 1 commit intomainfrom
feat/at-prefix-suppress-command-output
Mar 9, 2026
Merged

feat: add @ prefix to suppress command echoing (Issue #6)#40
seanseannery merged 1 commit intomainfrom
feat/at-prefix-suppress-command-output

Conversation

@seanseannery
Copy link
Owner

Key Changes

  • Commands are now echoed to stderr before execution by default (like Make)
  • Added @ prefix support: prefixing an Opsfile command line with @ suppresses echoing for that line
  • --silent flag suppresses all echoing globally
  • --dry-run prints all resolved lines with @ stripped (unaffected by prefix)
  • New ResolvedLine struct carries per-line Silent metadata through the pipeline
  • Execute() now accepts an io.Writer for echo output (testable, passes os.Stderr in production)

Why do we need this?

Users have no visibility into which shell lines are being run. This matches Make's behavior where commands are echoed before execution, and @ prefix provides granular suppression for cleaner output. Closes #6.

New modules or other dependencies introduced

None

How was this tested?

  • 18 new resolver tests covering @ stripping, variable substitution with @, backslash/indent continuation, double @@, bare @, @ in middle of line, @ in variable values, and regression checks
  • 8 new executor tests covering echo output, silent line suppression, global silent flag, mixed scenarios, and error cases
  • All 97 tests pass, make lint clean
  • Design doc: docs/feature-at-prefix-suppress.md
  • Test plan: docs/testplans/testplan-at-prefix-suppress.md

Add Makefile-style @ prefix support for Opsfile command lines. Commands
are now echoed to stderr before execution by default. Prefixing a line
with @ suppresses echoing for that line. --silent suppresses all echoing.
@seanseannery seanseannery merged commit 3bb2e4e into main Mar 9, 2026
4 checks 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.

Opsfiles support Makefile @ prefixes to supress printing individual commands

1 participant