You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Issue #21 proposes a ? per-line prefix to mark individual shell lines as requiring confirmation. However, there are situations where an operator wants to step through every command in a block interactively — for example, when running an unfamiliar Opsfile for the first time, auditing what a command actually does in a given environment, or exercising extra caution during a sensitive production incident.
A global --confirm / -c flag provides this safety net without requiring every line in the Opsfile to be prefixed with ?.
Proposal
Add a -c / --confirm CLI flag that forces interactive confirmation before executing every shell line, regardless of whether the line carries a ? prefix.
Problem This Solves
Issue #21 proposes a
?per-line prefix to mark individual shell lines as requiring confirmation. However, there are situations where an operator wants to step through every command in a block interactively — for example, when running an unfamiliar Opsfile for the first time, auditing what a command actually does in a given environment, or exercising extra caution during a sensitive production incident.A global
--confirm/-cflag provides this safety net without requiring every line in the Opsfile to be prefixed with?.Proposal
Add a
-c/--confirmCLI flag that forces interactive confirmation before executing every shell line, regardless of whether the line carries a?prefix.Usage:
Runtime behaviour:
When
--confirmis active,opstreats every shell line as if it had a?prefix:Execute? [y/N]:yorY→ executes the line normallySkipped.and moves to the next lineInteraction with other flags and prefixes:
?-prefixed lines (Issue feat: confirm-before-execute prefix syntax for destructive Opsfile commands #21):--confirmis additive — lines already marked?behave identically; unmarkded lines gain the same behaviour--dry-run: takes precedence — no prompts shown, resolved commands printed with a[confirm]annotation--silent: does not suppress confirmation prompts (same as?prefix behaviour)-(ignore-error prefix) and@(suppress-echo prefix): unaffected by--confirmExample session:
Acceptance Criteria
Flag parsing:
-cand--confirmare accepted as equivalent flags--confirmis reflected inOpsFlagsasConfirm bool--dry-run)Executor:
--confirmis set and stdin is a TTY: every shell line is printed and prompted withExecute? [y/N]:before executionyorYexecutes the line; any other input skips it and printsSkipped.--confirmis ignored and all lines execute without prompting (non-interactive mode must not hang)--dry-runtakes precedence over--confirm: no prompts shown; resolved lines printed with[confirm]annotation?prefix (Issue feat: confirm-before-execute prefix syntax for destructive Opsfile commands #21) and--confirmactive behave identically to lines without?and--confirmactive — no double-prompting-prefix is also set)Tests:
-cand--confirmboth setOpsFlags.Confirm--confirmprompts for every line;yexecutes, non-yskips--confirmexecutes all lines without prompting--dry-run --confirmprints annotation, no prompt?-prefixed line with--confirmdoes not double-prompt