Skip to content

fix(cli): preserve mode flags used as option values - #425

Merged
runkids merged 1 commit into
mainfrom
runkids/422-mode-option-values
Oct 5, 2026
Merged

runkids merged 1 commit into
mainfrom
runkids/422-mode-option-values

Conversation

@runkids

@runkids runkids commented Oct 5, 2026

Copy link
Copy Markdown
Owner

Type

  • Bug fix
  • Small improvement (docs, typo, minor refactor) — not the primary change
  • Feature proposal — not applicable

Summary

Option values such as --group -p were consumed by the mode parser before the command could parse them, selecting the wrong scope or conflicting with a real -g flag. Commands now declare their value-taking options to the shared parser, which preserves each value and the -- delimiter. MCP uses the same delimiter handling.

Covers existing callers, including audit rules --pattern/--severity, enable/disable --kind, and backup --delete. Existing command validation remains in place, and optional search --hub behavior is preserved.

Linked Issue

Refs #422.

The link/unlink commands from #421 are not in this checkout. Their caller must register --name and their create/remove acceptance test must be verified when the branches are integrated; this PR does not automatically close #422.

Validation

  • Confirmed regression cases fail before the fixes and pass afterward.
  • Parser unit tests cover mode-looking values, aliases, repeated options, missing values, --, equals syntax, optional flags, and real mode conflicts.
  • CLI regression table covers 33 command/subcommand cases, plus both mode-looking install names reaching existing name validation.
  • Linux devcontainer: focused tests and full make check passed.
  • python3 scripts/ai-context.py check and git diff --check passed.
  • Native Windows/macOS runtime tests were not run; link/unlink acceptance remains pending feat: add link and unlink for followed source folders #421 integration.

Checklist

  • I've read CONTRIBUTING.md
  • Tests included and passing (make check) — for code changes
  • No unrelated changes in the diff
  • Scope is focused — one concern per PR

Pass value-taking options to the shared mode parser so command values cannot select a scope or create false mode conflicts. Preserve the end-of-options delimiter and reuse it for MCP command arguments.

Cover existing CLI entry points, including audit rules, enable/disable, and backup deletion, with regression tests and document the parser contract.
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 5, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-05T15:35:18.694409Z e329f5d Manual request
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@runkids

runkids commented Oct 5, 2026

Copy link
Copy Markdown
Owner Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Swish!

Reviewed commit: e329f5d906

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@runkids
runkids merged commit 1d66193 into main Oct 5, 2026
8 checks passed
@runkids
runkids deleted the runkids/422-mode-option-values branch October 5, 2026 16:01
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.

CLI: an option value such as --name -g is parsed as the mode flag

1 participant