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 run with stdin input will not work - add to Gotchas? #904

Closed
respeccing opened this issue Apr 4, 2016 · 1 comment
Closed

cargo run with stdin input will not work - add to Gotchas? #904

respeccing opened this issue Apr 4, 2016 · 1 comment

Comments

@respeccing
Copy link

Unless I'm missing something, there's a difference between running rustfmt directly(works) versus running it via cargo run --bin rustfmt -- (doesn't output formatted program, if input is stdin)

$ cargo build
...
$ echo 'fn main(){}'| ./target/debug/rustfmt
fn main() {}
$ echo 'fn main(){}'| cargo run --bin rustfmt --
     Running `target/debug/rustfmt`

(that Running part is on stdout, but can add --quiet flag to cargo run to avoid it, that's not a problem)

cargo 0.10.0 (132b82d 2016-03-19) (from 16 days ago)

This seems like a cargo issue though... eg. not properly redirecting stdin to executed program?
If this cargo issue won't be fixed, may I suggest adding this to Gotchas?

EDIT: Quick look: This looks like it should've fixed it rust-lang/cargo#268 but apparently it didn't...

EDIT2: The issue is this: rust-lang/cargo#2530

@respeccing
Copy link
Author

This was fixed in cargo (5 days ago)
rust-lang/cargo#2530 (comment)

My bad, I was using an outdated version of cargo ;-)

Just tested it to have been fixed.
cargo 0.10.0 (12f76a5 2016-04-02)

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

1 participant