From d9b899309dbba0921350bb7f8d947dbf3efec48d Mon Sep 17 00:00:00 2001 From: Eric Traut Date: Sun, 5 Apr 2026 22:09:19 -0700 Subject: [PATCH] Fix misleading codex exec help usage (#16881) Addresses #15535 Problem: `codex exec --help` advertised a second positional `[COMMAND]` even though `exec` only accepts a prompt or a subcommand. Solution: Override the `exec` usage string so the help output shows the two supported invocation forms instead of the phantom positional. --- codex-rs/exec/src/cli.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/codex-rs/exec/src/cli.rs b/codex-rs/exec/src/cli.rs index 9e37769f1..22c53da1a 100644 --- a/codex-rs/exec/src/cli.rs +++ b/codex-rs/exec/src/cli.rs @@ -6,7 +6,10 @@ use codex_utils_cli::CliConfigOverrides; use std::path::PathBuf; #[derive(Parser, Debug)] -#[command(version)] +#[command( + version, + override_usage = "codex exec [OPTIONS] [PROMPT]\n codex exec [OPTIONS] [ARGS]" +)] pub struct Cli { /// Action to perform. If omitted, runs a new non-interactive session. #[command(subcommand)]