1
0
Fork 0
mirror of https://github.com/tldr-pages/tldr.git synced 2025-04-21 21:42:08 +02:00
tldr/pages/common/cargo-run.md
Lena 554fd30c20
cargo, cargo-{build,check,doc,run,test}: add option placeholders (#15895)
Co-authored-by: Darío Hereñú <magallania@gmail.com>
2025-03-15 23:28:32 +02:00

759 B

cargo run

Run the current Cargo package. Note: the working directory of the executed binary will be set to the current working directory. More information: https://doc.rust-lang.org/cargo/commands/cargo-run.html.

  • Run the default binary target:

cargo {{[r|run]}}

  • Run the specified binary:

cargo {{[r|run]}} --bin {{name}}

  • Run the specified example:

cargo {{[r|run]}} --example {{name}}

  • Activate a space or comma separated list of features:

cargo {{[r|run]}} {{[-F|--features]}} "{{feature1 feature2 ...}}"

  • Disable the default features:

cargo {{[r|run]}} --no-default-features

  • Activate all available features:

cargo {{[r|run]}} --all-features

  • Run with the given profile:

cargo {{[r|run]}} --profile {{name}}