Repository navigation
Done
Labels
status:needs-triageAn issue that hasn't had any proper look
Milestone
Description
Bug report form
- I have done a basic search of the issue tracker to find any existing issues that are similar.
- I have checked that my version is at least the latest stable release available via my installation method.
Describe the bug
After I installed completions for cargo:
let dir = $nu.user-autoload-dirs | first; mkdir $dir; generate completions 'cargo' | save --force ($dir | path join cargo.nu)the following stopped working:
V:\tmp> cargo -Zscript fp_asm.rs
Error: nu::parser::only_last_flag_in_batch_can_take_arg
× Only the last flag in a short flag batch can take an argument.
╭─[repl_entry #3:1:8]
1 │ cargo -Zscript fp_asm.rs
· ┬
· ╰── only the last flag can take args
╰────Separating the arg (-Z script) still works. Without the completions installed, the REPL doesn't complain, and the joined arg (Zscript) works just fine.
How to reproduce
- Install completions for cargo:
let dir = $nu.user-autoload-dirs | first; mkdir $dir; generate completions 'cargo' | save --force ($dir | path join cargo.nu)- Attempt to run cargo with a flag with args, placing the arg directly after the flag, e.g.
cargo -Zscript test.rs. This should start showing a repl error, and fail when executed. Running the command with the argument separated,cargo -Z script test.rs, does not fail. - Try to run the same command without completions installed. The command should execute without issue in both cases.
Expected behavior
The REPL should parse and allow short flags with arguments directly after them. I believe that entering the argument without a separating space is quite common, cargo parses it correctly, and the Cargo book lists both examples (-Zscript example here).
Configuration
| key | value |
|---|---|
| version | 0.117.1 |
| major | 0 |
| minor | 117 |
| patch | 1 |
| branch | main |
| commit_hash | 3d8a9cc |
| build_os | windows-x86_64 |
| build_target | x86_64-pc-windows-msvc |
| rust_version | rustc 1.102.0-nightly (5f4effd57 2026-11-13) |
| rust_channel | nightly-x86_64-pc-windows-msvc |
| cargo_version | cargo 1.102.0-nightly (ede6cefea 2026-11-11) |
| build_time | 2026-11-19 21:00:50 +01:00 |
| build_rust_channel | release |
| allocator | standard |
| features | dap, default, full, lsp, mcp, network, plugin, rustls-tls, sqlite, system-clipboard, trash-support |
| installed_plugins | dns 4.0.9, formats 0.105.1, gstat 0.105.1, inc 0.105.1, polars 0.105.1, query 0.105.1 |
| experimental_options | example=false, dc-glob=false, reorder-cell-paths=true, pipefail=true, enforce-runtime-annotations=true, native-clip=false, cell-path-types=false |
Metadata
Metadata
Assignees
Labels
status:needs-triageAn issue that hasn't had any proper look
Activity
fdncred commentedon Nov 23, 2026
Looking into this
fdncred commentedon Nov 23, 2026
Can you test this to see if it helps #19642 ?
fix(parser): pass `-Zscript` and `-j8` through to a known external (n…