CARGO-HELP(1)

πŸ“¦ version 1.96.1, in ubuntu stonking

✨ CARGO-HELP ✨

okay so bestie, welcome to the General Commands Manual page for cargo-help πŸ’– this is the lil' corner of the Cargo universe that's literally just here to hand you help. no builds, no drama, just answers 🫢


🌸 NAME 🌸

cargo-help β€” get help for a Cargo command πŸ’…


πŸŽ€ SYNOPSIS πŸŽ€

cargo help [subcommand]

πŸ¦‹ DESCRIPTION πŸ¦‹

It prints a help message for whatever command you name. that's it. that's the whole job. iconic behaviour honestly ✨

For commands that have subcommands, you separate the command levels with spaces. So like, cargo help report future-incompatibilities shows you the help for the cargo report future-incompatibilities command. no cap πŸ’–

⚠️ spaces only separate hierarchy levels between a parent command and its subcommands. if a dash is genuinely part of a command's name β€” think generate-lockfile β€” you gotta keep that dash. always. fr fr.

You can also write multiple command levels as a single dash-joined word</> 🧚 so cargo help report-future-incompatibilities is literally equivalent to cargo help report future-incompatibilities. same energy, different fit πŸ’…


πŸ’– OPTIONS πŸ’–

🌈 Display Options 🌈

  • -v, --verbose β€” use verbose output. You can specify it twice for "very verbose" output, which adds extra stuff like dependency warnings and build script output. You can also set this with the term.verbose config value <https://doc.rust-lang.org/cargo/reference/config.html>. obsessed with the double-v, honestly 😭
  • -q, --quiet β€” do not print cargo log messages. Can also be set with the term.quiet config value <https://doc.rust-lang.org/cargo/reference/config.html>. the introvert flag 🫢
  • --color when β€” controls when colored output gets used. the valid values are:
    • auto (default) β€” automatically detects whether your terminal can do color support.
    • always β€” always display colors. go off 🌈
    • never β€” never display colors. minimalist moment.

Can also be set with the term.color config value <https://doc.rust-lang.org/cargo/reference/config.html>.

πŸ“ Manifest Options πŸ“

  • --locked β€” asserts that the exact same dependencies and versions are used as when the existing Cargo.lock file was originally generated. Cargo will exit with an error when either of these scenarios shows up:
    • The lock file is missing. πŸ’€
    • Cargo attempted to change the lock file due to a different dependency resolution.

It may be used in environments where deterministic builds are the vibe, such as in CI pipelines. reproducibility queen πŸ‘‘

  • --offline β€” prevents Cargo from accessing the network for any reason. Without this flag, Cargo will stop with an error if it needs the network and the network isn't available. With this flag, Cargo will attempt to proceed without the network if possible.
beware bestie, this may result in different dependency resolution than online mode 😭 Cargo will restrict itself to crates that are downloaded locally, even if there might be a newer version as indicated in the local copy of the index. See the cargo-fetch(1) command to download dependencies before going offline.

Can also be set with the net.offline config value <https://doc.rust-lang.org/cargo/reference/config.html>.

  • --frozen β€” equivalent to specifying both --locked and --offline. two-for-one deal, slay πŸ’…

πŸ’œ Common Options πŸ’œ

  • +toolchain β€” if Cargo has been installed with rustup, and the first argument to cargo begins with +, it gets interpreted as a rustup toolchain name (like +stable or +nightly). See the rustup documentation <https://rust-lang.github.io/rustup/overrides.html> for more info about how toolchain overrides work. ✨
  • --config KEY=VALUE or PATH β€” overrides a Cargo configuration value. The argument should be in TOML syntax of KEY=VALUE, or provided as a path to an extra configuration file. This flag may be specified multiple times. See the command-line overrides section <https://doc.rust-lang.org/cargo/reference/config.html#command-line-overrides> for more info. stack 'em up 🧚
  • -C PATH β€” changes the current working directory before executing any specified operations. This affects things like where cargo looks by default for the project manifest (Cargo.toml), as well as the directories searched for discovering .cargo/config.toml, for example. This option must appear before the command name, like cargo -C path/to/my-project build.
This option is only available on the nightly channel <https://doc.rust-lang.org/book/appendix-07-nightly-rust.html> and requires the -Z unstable-options flag to enable (see #10098 <https://github.com/rust-lang/cargo/issues/10098>). nightly girlies only πŸŒ™
  • -h, --help β€” prints help information. very meta of us πŸ’–
  • -Z flag β€” unstable (nightly-only) flags to Cargo. Run cargo -Z help for details. mysterious. secret menu energy 🫣

🌱 ENVIRONMENT 🌱

See the reference <https://doc.rust-lang.org/cargo/reference/environment-variables.html> for the deets on environment variables that Cargo reads. iykyk πŸ’š


⭐ EXIT STATUS ⭐

  • 0 β€” Cargo succeeded. we love a win πŸŽ‰
  • 101 β€” Cargo failed to complete. it's giving tragedy 😭

🌟 EXAMPLES 🌟

  1. Get help for a command:
cargo help build
  1. Get help for a nested command:
cargo help report future-incompatibilities
  1. The dash-joined form also works:
cargo help report-future-incompatibilities
  1. Help is also available with the --help flag:
cargo build --help

πŸ‘‘ SEE ALSO πŸ‘‘

cargo(1)


and that's the whole page bestie!! πŸŽ€ this was the CARGO-HELP(1) page from the General Commands Manual, and yeah β€” the little footer tag at the bottom says CARGO-HELP(1) too, so now you know where you are πŸ’– go read some help, you deserve it βœ¨πŸ¦‹

πŸ“¦ where this page comes from