diff --git a/README.md b/README.md index d79e53b7a32..7347499c824 100644 --- a/README.md +++ b/README.md @@ -28,7 +28,8 @@ You can run Rustfmt by just typing `rustfmt filename` if you used `Cargo install`. This runs rustfmt on the given file, if the file includes out of line modules, then we reformat those too. So to run on a whole module or crate, you just need to run on the root file (usually mod.rs or lib.rs). Rustfmt can also -read data from stdin. +read data from stdin. Alternatively, you can use `cargo fmt` to format all Rust +files in the `src` directory of your crate. You'll probably want to specify the write mode. Currently, there are modes for replace, overwrite, display, and coverage. The replace mode is the default @@ -59,8 +60,9 @@ First make sure you've got Rust **1.4.0** or greater available, then: `cargo test` to run all tests. -To run rustfmt after this, use `cargo run -- filename`. See the notes above on -running rustfmt. +To run rustfmt after this, use `cargo run --bin rustfmt -- filename`. See the +notes above on running rustfmt. To run cargo-fmt, use +`cargo run --bin cargo-fmt` ## What style does Rustfmt use?