.TH RUSTFMT 1 .SH NAME rustfmt \- Formater for Rust code .SH SYNOPSYS .B rustfmt [\fIOPTIONS\fR] \fIINPUT\fR .TP \fBrustfmt\fR [source.rs] Format a file, overwriting the original file in-place: .TP \fBrustfmt --check\fR [source.rs] Check a file for formatting and display any changes on the console: .TP \fBrustfmt --backup\fR [source.rs] Backup any modified files before formatting (the original file is renamed with a .bk extension): .SH DESCRIPTION This program is a formater for Rust language code, available at https://www.rust\-lang.org. .SH OPTIONS .TP \fB\-\-check\fR Run in 'check' mode. Exits with 0 if input is formatted correctly. Exits with 1 and prints a diff if formatting is required. .TP \fB\-\-emit\fR [files|stdout|coverage|checkstyle|json] What data to emit and how .TP \fB\-\-backup\fR Backup any modified files. .TP \fB\-\-config\-path\fR [Path for the configuration file] Recursively searches the given path for the rustfmt.toml config file. If not found reverts to the input file path .TP \fB\-\-edition\fR [2015|2018|2021] Rust edition to use .TP \fB\-\-color\fR [always|never|auto] Use colored output (if supported) .TP \fB\-\-print\-config\fR [default|minimal|current] PATH Dumps a default or minimal config to PATH. A minimal config is the subset of the current config file used for formatting the current program. `current` writes to stdout current config as if formatting the file at PATH. .TP \fB\-l\fR, \fB\-\-files\-with\-diff\fR Prints the names of mismatched files that were formatted. Prints the names of files that would be formatted when used with `\-\-check` mode. .TP \fB\-\-config\fR [key1=val1,key2=val2...] Set options from command line. These settings take priority over .rustfmt.toml .TP \fB\-\-unstable\-features\fR Enables unstable features. Only available on nightly channel. .TP \fB\-\-file\-lines\fR JSON Format specified line ranges. Run with `\-\-help=file\-lines` for more detail (unstable). .TP \fB\-\-error\-on\-unformatted\fR Error if unable to get comments or string literals within max_width, or they are left with trailing whitespaces (unstable). .TP \fB\-\-skip\-children\fR Don't reformat child modules (unstable). .TP \fB\-v\fR, \fB\-\-verbose\fR Print verbose output .TP \fB\-q\fR, \fB\-\-quiet\fR Print less output .TP \fB\-V\fR, \fB\-\-version\fR Show version information .TP \fB\-h\fR, \fB\-\-help\fR [=TOPIC] Show this message or help about a specific topic: `config` or `file\-lines`