Fix deprecated login --api-key parsing (#16658)

Addresses #16655

Problem: `codex login --api-key` failed in Clap before Codex could show
the deprecation guidance.

Solution: Allow the hidden `--api-key` flag to parse with zero or one
values so both forms reach the `--with-api-key` message.
This commit is contained in:
Eric Traut
2026-04-02 22:43:53 -07:00
committed by GitHub
parent 6db6de031a
commit 8cd7f20b48

View File

@@ -287,6 +287,8 @@ struct LoginCommand {
#[arg(
long = "api-key",
num_args = 0..=1,
default_missing_value = "",
value_name = "API_KEY",
help = "(deprecated) Previously accepted the API key directly; now exits with guidance to use --with-api-key",
hide = true