cargo locate-project
NAME
cargo-locate-project - Print a JSON representation of a Cargo.toml file's location
SYNOPSIS
cargo locate-project [OPTIONS]
DESCRIPTION
This command will print a JSON object to stdout with the full path to theCargo.toml manifest.
See also cargo-metadata(1) which is capable of returning the path to aworkspace root.
OPTIONS
Display Options
- -v
- —verbose
- Use verbose output. May be specified twice for "very verbose" output whichincludes extra output such as dependency warnings and build script output.May also be specified with the
term.verboseconfig value. - -q
- —quiet
- No output printed to stdout.
- —colorWHEN
-
Control when colored output is used. Valid values:
-
auto(default): Automatically detect if color support is available on theterminal. always: Always display colors.never: Never display colors.
May also be specified with the term.colorconfig value.
Manifest Options
- —manifest-pathPATH
- Path to the
Cargo.tomlfile. By default, Cargo searches in the currentdirectory or any parent directory for theCargo.tomlfile.
Common Options
- -h
- —help
- Prints help information.
- -ZFLAG…
- Unstable (nightly-only) flags to Cargo. Run
cargo -Z helpfordetails.
ENVIRONMENT
See the reference fordetails on environment variables that Cargo reads.
Exit Status
- 0
- Cargo succeeded.
- 101
- Cargo failed to complete.
EXAMPLES
- Display the path to the manifest based on the current directory:
1. cargo locate-project
