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

Support passing arguments down to cargo subprocess (ie --) #14

Open
2 of 3 tasks
epage opened this issue Sep 10, 2018 · 4 comments
Open
2 of 3 tasks

Support passing arguments down to cargo subprocess (ie --) #14

epage opened this issue Sep 10, 2018 · 4 comments
Labels
enhancement Improve the expected

Comments

@epage
Copy link
Contributor

epage commented Sep 10, 2018

Status:

  • cargo run
  • cargo test
  • cargo build: doesn't support --.

As we add new sub-commands, we'll need to remember to take this into account. That means it should be documented somewhere. Possibilities include cargo.rs, PR template, and contributing guide.

@epage epage added enhancement Improve the expected question Uncertainty is involved labels Sep 10, 2018
@epage
Copy link
Contributor Author

epage commented Sep 10, 2018

I thought I remember some extra flags for these but running cargo build -- --help errors.

@roblabla
Copy link

I don't think cargo build supports --. cargo run does, it passes the args to the underlying process. cargo test does, it passes the args to the test runner (e.g. cargo test -- --nocapture to print stdout). cargo rustc does, it passes the args to the compiler. Same deal for cargo rustdoc.

There's a general pattern: -- is to pass arguments down to a subprocess that cargo is "hiding".

@epage
Copy link
Contributor Author

epage commented Sep 10, 2018

Oh, when I ran cargo test, I ignored it once I saw it compiling. It does support -- --help. It just needs to build all of the test targets first so it has something to call --help on.

@epage epage changed the title Do some subcommands need a way for passing -- arguments? Support passing arguments down to cargo subprocess (ie --) Sep 10, 2018
@epage
Copy link
Contributor Author

epage commented Sep 10, 2018

Thanks, I've updated the title and issue.

@epage epage removed the question Uncertainty is involved label Sep 10, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Improve the expected
Projects
None yet
Development

No branches or pull requests

2 participants