Go to main content

man pages section 1: User Commands

Exit Print View

Updated: Thursday, June 13, 2019
 
 

cargo-run (1)

Name

cargo-run - Run the current project

Synopsis

cargo run [OPTIONS] [--] [<ARGS>...]

Description

CARGO-RUN(1)                     Cargo Manual                     CARGO-RUN(1)



NAME
       cargo-run - Run the current project

SYNOPSIS
       cargo run [OPTIONS] [--] [<ARGS>...]

DESCRIPTION
       Run the main binary of the local package (src/main.rs).

       If  neither --bin nor --example are given, then if the project only has
       one bin target it will be run.  Otherwise --bin specifies the bin  tar-
       get to run, and --example specifies the example target to run.  At most
       one of --bin or --example can be provided.

       All of the trailing arguments 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
       -h, --help
              Print this message.

       --bin NAME
              Name of the bin target to run.

       --example NAME
              Name of the example target to run.

       -j IN, --jobs IN
              Number of parallel jobs, defaults to # of CPUs.

       --release
              Build artifacts in release mode, with optimizations.

       --features FEATURES
              Space-separated list of features to also build.

       --all-features
              Build all available features.

       --no-default-features
              Do not build the default feature.

       --target TRIPLE
              Build for the target triple.

       --manifest-path PATH
              Path to the Cargo.toml to compile.

       -v, --verbose
              Use verbose output.

       -q, --quiet
              No output printed to stdout.

       --color WHEN
              Coloring: auto, always, never.

EXAMPLES
       Run the main binary of the current package

              $ cargo run


ATTRIBUTES
       See attributes(7) for descriptions of the following attributes:


       +---------------+----------------------+
       |ATTRIBUTE TYPE |   ATTRIBUTE VALUE    |
       +---------------+----------------------+
       |Availability   | developer/rust/cargo |
       +---------------+----------------------+
       |Stability      | Volatile             |
       +---------------+----------------------+
SEE ALSO
       cargo(1), cargo-new(1), cargo-init(1), cargo-build(1)

COPYRIGHT
       This work is dual-licensed under Apache 2.0 and MIT terms.   See  COPY-
       RIGHT file in the cargo source distribution.



NOTES
       This software was built from source available at https://github.com/or-
       acle/solaris-userland.  The original community  source  was  downloaded
       from  https://static.rust-lang.org/dist/rustc-1.28.0-src.tar.xz

       Further information about this software can be found on the open source
       community website at http://www.rust-lang.org/.



The Rust package manager           May 2016                       CARGO-RUN(1)