TreeOptions-ispec, --invertspec
Show the reverse dependencies for the given package. This flag will invert the tree and display the
packages that depend on the given package.
Note that in a workspace, by default it will only display the package’s reverse dependencies inside
the tree of the workspace member in the current directory. The --workspace flag can be used to extend
it so that it will show the package’s reverse dependencies across the entire workspace. The -p flag
can be used to display the package’s reverse dependencies only with the subtree of the package given
to -p.
--prunespec
Prune the given package from the display of the dependency tree.
--depthdepth
Maximum display depth of the dependency tree. A depth of 1 displays the direct dependencies, for
example.
--no-dedupe
Do not de-duplicate repeated dependencies. Usually, when a package has already displayed its
dependencies, further occurrences will not re-display its dependencies, and will include a (*) to
indicate it has already been shown. This flag will cause those duplicates to be repeated.
-d, --duplicates
Show only dependencies which come in multiple versions (implies --invert). When used with the -p
flag, only shows duplicates within the subtree of the given package.
It can be beneficial for build times and executable sizes to avoid building that same package
multiple times. This flag can help identify the offending packages. You can then investigate if the
package that depends on the duplicate with the older version can be updated to the newer version so
that only one instance is built.
-ekinds, --edgeskinds
The dependency kinds to display. Takes a comma separated list of values:
• all — Show all edge kinds.
• normal — Show normal dependencies.
• build — Show build dependencies.
• dev — Show development dependencies.
• features — Show features enabled by each dependency. If this is the only kind given, then it will
automatically include the other dependency kinds.
• no-normal — Do not include normal dependencies.
• no-build — Do not include build dependencies.
• no-dev — Do not include development dependencies.
• no-proc-macro — Do not include procedural macro dependencies.
The normal, build, dev, and all dependency kinds cannot be mixed with no-normal, no-build, or no-dev
dependency kinds.
The default is normal,build,dev.
--targettriple
Filter dependencies matching the given targettriple
<https://doc.rust-lang.org/cargo/appendix/glossary.html#target>. The default is the host platform.
Use the value all to include all targets.
TreeFormattingOptions--charsetcharset
Chooses the character set to use for the tree. Valid values are “utf8” or “ascii”. When unspecified,
cargo will auto-select a value.
-fformat, --formatformat
Set the format string for each package. The default is “{p}”.
This is an arbitrary string which will be used to display each package. The following strings will be
replaced with the corresponding value:
• {p} — The package name.
• {l} — The package license.
• {r} — The package repository URL.
• {f} — Comma-separated list of package features that are enabled.
• {lib} — The name, as used in a use statement, of the package’s library.
--prefixprefix
Sets how each line is displayed. The prefix value can be one of:
• indent (default) — Shows each line indented as a tree.
• depth — Show as a list, with the numeric depth printed before each entry.
• none — Show as a flat list.
PackageSelection
By default, when no package selection options are given, the packages selected depend on the selected
manifest file (based on the current working directory if --manifest-path is not given). If the manifest
is the root of a workspace then the workspaces default members are selected, otherwise only the package
defined by the manifest will be selected.
The default members of a workspace can be set explicitly with the workspace.default-members key in the
root manifest. If this is not set, a virtual workspace will include all workspace members (equivalent to
passing --workspace), and a non-virtual workspace will include only the root crate itself.
-pspec…, --packagespec…
Display only the specified packages. See cargo-pkgid(1) for the SPEC format. This flag may be
specified multiple times and supports common Unix glob patterns like *, ? and []. However, to avoid
your shell accidentally expanding glob patterns before Cargo handles them, you must use single quotes
or double quotes around each pattern.
--workspace
Display all members in the workspace.
--excludeSPEC…
Exclude the specified packages. Must be used in conjunction with the --workspace flag. This flag may
be specified multiple times and supports common Unix glob patterns like *, ? and []. However, to
avoid your shell accidentally expanding glob patterns before Cargo handles them, you must use single
quotes or double quotes around each pattern.
ManifestOptions--manifest-pathpath
Path to the Cargo.toml file. By default, Cargo searches for the Cargo.toml file in the current
directory or any parent directory.
--frozen, --locked
Either of these flags requires that the Cargo.lock file is up-to-date. If the lock file is missing,
or it needs to be updated, Cargo will exit with an error. The --frozen flag also prevents Cargo from
attempting to access the network to determine if it is out-of-date.
These may be used in environments where you want to assert that the Cargo.lock file is up-to-date
(such as a CI build) or want to avoid network access.
--offline
Prevents Cargo from accessing the network for any reason. Without this flag, Cargo will stop with an
error if it needs to access the network and the network is not available. With this flag, Cargo will
attempt to proceed without the network if possible.
Beware that 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.
May also be specified with the net.offlineconfigvalue
<https://doc.rust-lang.org/cargo/reference/config.html>.
FeatureSelection
The feature flags allow you to control which features are enabled. When no feature options are given, the
default feature is activated for every selected package.
See thefeaturesdocumentation
<https://doc.rust-lang.org/cargo/reference/features.html#command-line-feature-options> for more details.
-Ffeatures, --featuresfeatures
Space or comma separated list of features to activate. Features of workspace members may be enabled
with package-name/feature-name syntax. This flag may be specified multiple times, which enables all
specified features.
--all-features
Activate all available features of all selected packages.
--no-default-features
Do not activate the default feature of the selected packages.
DisplayOptions-v, --verbose
Use verbose output. May be specified twice for “very verbose” output which includes extra output such
as dependency warnings and build script output. May also be specified with the term.verboseconfigvalue <https://doc.rust-lang.org/cargo/reference/config.html>.
-q, --quiet
Do not print cargo log messages. May also be specified with the term.quietconfigvalue
<https://doc.rust-lang.org/cargo/reference/config.html>.
--colorwhen
Control when colored output is used. Valid values:
• auto (default): Automatically detect if color support is available on the terminal.
• always: Always display colors.
• never: Never display colors.
May also be specified with the term.colorconfigvalue
<https://doc.rust-lang.org/cargo/reference/config.html>.
CommonOptions+toolchain
If Cargo has been installed with rustup, and the first argument to cargo begins with +, it will be
interpreted as a rustup toolchain name (such as +stable or +nightly). See the rustupdocumentation
<https://rust-lang.github.io/rustup/overrides.html> for more information about how toolchain
overrides work.
--configKEY=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-lineoverridessection
<https://doc.rust-lang.org/cargo/reference/config.html#command-line-overrides> for more information.
-CPATH
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, for example cargo-Cpath/to/my-projectbuild.
This option is only available on the nightlychannel
<https://doc.rust-lang.org/book/appendix-07-nightly-rust.html> and requires the -Zunstable-options
flag to enable (see #10098 <https://github.com/rust-lang/cargo/issues/10098>).
-h, --help
Prints help information.
-Zflag
Unstable (nightly-only) flags to Cargo. Run cargo-Zhelp for details.