Skip to content

cargo fmt -- --help displays no output #7027

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

Closed
carols10cents opened this issue Jun 11, 2019 · 2 comments · Fixed by rust-lang/rustfmt#3620
Closed

cargo fmt -- --help displays no output #7027

carols10cents opened this issue Jun 11, 2019 · 2 comments · Fixed by rust-lang/rustfmt#3620
Labels

Comments

@carols10cents
Copy link
Member

carols10cents commented Jun 11, 2019

Problem

I ran cargo fmt -- --help and didn't get any output. I expected to get the same output that I do get when I run rustfmt --help, especially because the last line in cargo fmt --help says Arguments after `--` are passed to rustfmt.

The weirdest part is if I run cargo fmt -- --help=config, I do get the same output as I get if I run rustfmt --help=config, the configuration specific help. So cargo is passing through --help when it has an argument? And not passing it through when there isn't? I haven't investigated the cause at all, I'm just guessing based on the symptoms.

Steps

  1. Be on stable Rust with the rustfmt component installed.
  2. Run cargo fmt -- --help.
  3. Observe that there is no output.
  4. Observe the expected output by running rustfmt --help.

Notes

Output of cargo version: cargo 1.35.0 (6f3e9c3 2019-04-04)
Output of rustfmt --version: rustfmt 1.2.0-stable (09940a70 2019-03-27)
OS: macOS Mojave

@ehuss
Copy link
Contributor

ehuss commented Jun 11, 2019

This is a bug in rustfmt. I posted a fix at rust-lang/rustfmt#3620.

@ehuss
Copy link
Contributor

ehuss commented Jul 18, 2019

This is now fixed on nightly via rust-lang/rustfmt#3620 and rust-lang/rust#62688.

@ehuss ehuss closed this as completed Jul 18, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants