Skip to content

cargo completions: make --timings a switch - #1293

Merged
fdncred merged 1 commit into
nushell:mainfrom
qodelicious:fix-cargo-timings-flag
Oct 20, 2026
Merged

fdncred merged 1 commit into
nushell:mainfrom
qodelicious:fix-cargo-timings-flag

Conversation

@qodelicious

Copy link
Copy Markdown
Contributor

Fixes #1154

--timings was declared as --timings: string in the cargo externs, so nushell expects a value after it and cargo build --timings fails with "Missing flag argument". In cargo the value is optional (--timings[=<FMTS>]) and the plain flag is how it's normally used.

Changed it to a switch in all 7 places (build, check, doc, test, bench, install, clippy).

Tested with a stub cargo that just echoes its args

> use cargo-completions.nu *
> cargo build --timings
cargo got: build --timings

Before this it errored with nu::parser::missing_flag_param. It also stops cargo test --timings --release from treating --release as the timings value.

@fdncred
fdncred merged commit 8514f5e into nushell:main Oct 20, 2026
1 check passed
@fdncred

fdncred commented Oct 20, 2026 •

Copy link
Copy Markdown
Contributor

This could also be a oneof<string, bool> but we can try it the way it is. Thanks

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.

Unable to run cargo run --timings

2 participants