Skip to content

Latest commit

 

History

History
90 lines (51 loc) · 1.74 KB

cargo-run.adoc

File metadata and controls

90 lines (51 loc) · 1.74 KB

cargo-run(1) Manual Page

NAME

cargo-run - Run the current package

SYNOPSIS

cargo run [OPTIONS] [-- ARGS]

DESCRIPTION

Run a binary or example of the local package.

All the arguments following the two dashes (--) are passed to the binary to run. If you’re passing arguments to both Cargo and the binary, the ones after -- go to the binary, the ones before go to Cargo.

OPTIONS

Package Selection

Target Selection

When no target selection options are given, cargo run will run the binary target. If there are multiple binary targets, you must pass a target flag to choose one. Or, the default-run field may be specified in the [package] section of Cargo.toml to choose the name of the binary to run by default.

--bin NAME

Run the specified binary.

--example NAME

Run the specified example.

Output Options

Common Options

EXAMPLES

  1. Build the local package and run its main target (assuming only one binary):

    cargo run
  2. Run an example with extra arguments:

    cargo run --example exname -- --exoption exarg1 exarg2

SEE ALSO

man:cargo[1], man:cargo-build[1]