Skip to content

fix(exec): align exec help usage with parser#1

Draft
middleDuckAi wants to merge 1 commit intoupstream-main-20260324from
middleDuck/codex-15535-exec-help-contract
Draft

fix(exec): align exec help usage with parser#1
middleDuckAi wants to merge 1 commit intoupstream-main-20260324from
middleDuck/codex-15535-exec-help-contract

Conversation

@middleDuckAi
Copy link
Copy Markdown
Owner

@middleDuckAi middleDuckAi commented Mar 24, 2026

Summary

  • align codex exec --help with the actual parser contract
  • advertise the two real exec invocation forms instead of a phantom second positional
  • add a regression test for the exec help output

Why

Issue openai#15535 reports that codex exec --help advertises Usage: codex exec [OPTIONS] [PROMPT] [COMMAND], but the parser rejects a second positional argument. That makes the help output misleading for both humans and automation.

This change keeps parser behavior unchanged and fixes the contract shown in help instead:

  • codex exec [OPTIONS] [PROMPT]
  • codex exec [OPTIONS] <COMMAND> [ARGS]

Testing

  • cargo fmt --all --check
  • cargo run -p codex-cli -- exec --help | sed -n '1,20p'
  • cargo test -p codex-cli exec_help_does_not_advertise_a_second_positional
  • cargo test -p codex-cli exec_resume
  • printf '' | cargo run -p codex-cli -- exec --ephemeral --skip-git-repo-check --color never - false

Notes

  • Parser behavior is intentionally unchanged.
  • This PR only fixes the help/usage contract so automation and users are not misled by [PROMPT] [COMMAND].

@middleDuckAi middleDuckAi force-pushed the middleDuck/codex-15535-exec-help-contract branch from 3e7487c to 9089ffc Compare March 24, 2026 12:24
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.

1 participant