codex-plugin-cc icon indicating copy to clipboard operation
codex-plugin-cc copied to clipboard

fix: treat task --help and unknown flags as CLI errors (#539)

Open stantheman0128 opened this issue 4 months ago • 0 comments

Summary

  • parseArgs gains rejectUnknownOptions so unrecognized --flags throw instead of becoming prompt text.
  • Subcommand parsers enable that mode, accept --help/-h, and print usage without starting a Codex thread.
  • Fixes #539 (Windows-reproable; defect is in JS arg handling).

AI assistance

Assisted by Cursor/Grok. I reviewed the diff, ran the tests below, and checked open PRs for overlap (#128/#535 are test-only coverage; #378 is adversarial focus parsing).

Evidence

node --test tests/args.test.mjs tests/commands.test.mjs tests/render.test.mjs
# 14 pass (includes task --help + unknown --flag with fake-codex: no threads)

node --test --test-name-pattern "task runs when the active provider" tests/runtime.test.mjs
# 1 pass

Test plan

  • [x] task --help --cwd <tmp> --json prints Usage and exits 0
  • [x] task --not-a-real-flag errors with Unknown option and does not create a thread
  • [x] Normal task prompt still runs under fake-codex

stantheman0128 avatar Jul 23 '26 11:07 stantheman0128