Fix codex resume so flags (cd, model, search, etc.) still work (#3625)

Bug: now we can add flags/config values only before resume. 

`codex -m gpt-5 resume` works

However, `codex resume -m gpt-5` should also work.

This PR is following this
[approach](https://stackoverflow.com/questions/76408952/rust-clap-re-use-same-arguments-in-different-subcommand)
in doing so.

I didn't convert those flags to global because we have `codex login`
that shouldn't expect them.
This commit is contained in:
Ahmed Ibrahim
2025-09-15 02:16:17 -04:00
committed by GitHub
parent 6039f8a126
commit 2d52e3b40a
2 changed files with 214 additions and 11 deletions

View File

@@ -7,6 +7,7 @@ use std::path::PathBuf;
#[command(version)]
pub struct Cli {
/// Optional user prompt to start the session.
#[arg(value_name = "PROMPT")]
pub prompt: Option<String>,
/// Optional image(s) to attach to the initial prompt.