Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cargo completion make -- argument not working. #1004

Open
lll9p opened this issue Dec 30, 2024 · 3 comments
Open

cargo completion make -- argument not working. #1004

lll9p opened this issue Dec 30, 2024 · 3 comments

Comments

@lll9p
Copy link

lll9p commented Dec 30, 2024

cargo clippy --workspace -- -D warnings -D clippy::unwrap_used

will produced like:


error: unexpected argument '-' found

Usage: cargo.exe check [OPTIONS]

cargo test -- --nocapture

will produced like:

error: unexpected argument '--nocapture' found

  tip: a similar argument exists: '--features'
  tip: to pass '--nocapture' as a value, use '-- --nocapture'

Usage: cargo.exe test --features <FEATURES> <TESTNAME> [-- [ARGS]...]

For more information, try '--help'.

I must do the work like ^cargo test -- --nocapture , How can I fix this?

@fdncred
Copy link
Collaborator

fdncred commented Dec 30, 2024

it could be because -- is not supported in nushell. in order to pass this through there would have to be a def --wrapped name [] {} but that may also break custom completions too.

@ysthakur
Copy link
Member

I can reproduce this with our Cargo completions in nu_scripts (https://github.com/nushell/nu_scripts/blob/main/custom-completions/cargo/cargo-completions.nu), I assume that's what you're using @lll9p?

It's possible to do cargo test -- -- --nocapture to make sure that -- --nocapture is sent to cargo, but that's not a better solution than ^cargo. Not sure if there's a solution to this that's also easy to maintain for the person making completions.

@lll9p
Copy link
Author

lll9p commented Dec 31, 2024

@ysthakur You are right, I'm using nu_scripts' cargo-completions, the temporary workaround is fine, just wait for better solution.

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

No branches or pull requests

3 participants