Since replace is the default rustfmt write mode, there's no need to
call rustfmt with `--write-mode=replace`. As a bonus, it is now also
possible to override the write-mode.
Add a new utility, which formats all readable .rs files in the src
directory of the crate using rustfmt. Both binaries can be installed
using cargo install rustfmt. cargo-fmt can be used as a Cargo
subcommand - cargo fmt.
Usage messages traditionally use this as it contains the path that the
user provided to run the executable (e.g. `rustfmt` instead of
`/usr/local/bin/rustfmt`).
Fix#580 by allowing rustfmt to accept a list of files. This also
enables usage of shell wildcard expansion, although notably this does
not work with cmd.exe on Windows. For example: 'rustfmt *.rs' will
format all rust files in the current working directory.
- Change usage text to show rustfmt will accept a list of files
- Change "Using rustfmt config file: {}" message to
"Using rustfmt config file {} for {}"
- Change Operation::Format(PathBuf, WriteMode) to
Operation::Format(Vec<PathBuf>, WriteMode)
- Loop through Vec<PathBuf>, load config and call 'run' for each path
The existing help output is very verbose, overflowing a 50+ line
terminal. This moves the configuration options to a separate help flag
to make a mistyped command less annoying!
Adds support for receiving input from stdin in case no file was
specified. This is useful for editor/IDE integrations and other tooling.
To achieve clean output a new write-mode option called plain was added,
this option is mandatory when using stdin.
This removes usage of:
* PathExt
* split_last
* split_last_mut
* catch_panic
The catch_panic one was a little tricky as the ident interner needed to be
cloned across threads (a little unsafely), but it should otherwise be good to
go.