From 2105ae877983b76a7afa9986353bd8df511d423c Mon Sep 17 00:00:00 2001 From: dtzp555 Date: Mon, 11 May 2026 04:08:37 +1000 Subject: [PATCH] fix(ocp): forward all args to cmd_update so multi-flag invocations work MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Bug found via runtime smoke test: ./ocp update --rollback --list → "no snapshots" (wrong; should list) Root cause: dispatch was `cmd_update "\${1:-}"` (only first arg). When user typed `--rollback --list`, cmd_update only received `--rollback`, the shift left $@ empty, and exec node ... --rollback got no flags. Other commands using "\${1:-}" don't need multi-arg, but cmd_update now does (--rollback --list, --rollback --dry-run, --target X --yes, etc.). Change: dispatch is now `cmd_update "\$@"`. cmd_update internals already handle multi-arg correctly (\$1 == --check fast path; \$1 == --rollback shift+forward; otherwise doctor-driven). Verified: ./ocp update --check → existing behaviour preserved ./ocp update --rollback --list → "Found 0 snapshots:" exit 0 ./ocp update --rollback --dry-run → no-snapshot error exit 1 Co-Authored-By: Claude Opus 4.7 --- ocp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ocp b/ocp index 512e232..46cf8fb 100755 --- a/ocp +++ b/ocp @@ -901,6 +901,6 @@ case "$subcmd" in connect) cmd_connect "$@" ;; restart) cmd_restart "${1:-}" ;; doctor) cmd_doctor "$@" ;; - update) cmd_update "${1:-}" ;; + update) cmd_update "$@" ;; *) echo "Unknown command: $subcmd"; echo ""; cmd_help; exit 1 ;; esac