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.
This commit is contained in:
Eric Traut
2026-04-05 22:09:19 -07:00
committed by GitHub
parent b5edeb98a0
commit d9b899309d

View File

@@ -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] <COMMAND> [ARGS]"
)]
pub struct Cli {
/// Action to perform. If omitted, runs a new non-interactive session.
#[command(subcommand)]