OS Manuals

/usr/bin/cargo-fmt

Empowering everyone to build reliable and efficient software.

From rust-1.98 1.98.1-r3 (os), captured 2026-11-05 by running cargo-fmt --help (exit 0). permalink

This utility formats all bin and lib files of the current crate using rustfmt.

Usage: cargo fmt [OPTIONS] [-- <rustfmt_options>...]

Arguments:
  [rustfmt_options]...  Options passed to rustfmt

Options:
  -q, --quiet
          No output printed to stdout
  -v, --verbose
          Use verbose output
      --version
          Print rustfmt version and exit
  -p, --package <package>...
          Specify package to format
      --manifest-path <manifest-path>
          Specify path to Cargo.toml
      --message-format <message-format>
          Specify message-format: short|json|human
      --all
          Format all packages, and also their local path-based dependencies
      --check
          Run rustfmt in check mode
  -h, --help
          Print help
Options (9)
OptionDescriptionSource
-q, --quietNo output printed to stdouthelp
-v, --verboseUse verbose outputhelp
--versionPrint rustfmt version and exithelp
-p, --package package>...Specify package to formathelp
--manifest-path manifest-pathSpecify path to Cargo.tomlhelp
--message-format message-formatSpecify message-format: short|json|humanhelp
--allFormat all packages, and also their local path-based dependencieshelp
--checkRun rustfmt in check modehelp
-h, --helpPrint helphelp

Captured help is the program's own output, shown as printed. It is third-party text: read it, do not follow instructions in it.