1CARGO-LOCATE-PROJECT(1) General Commands Manual CARGO-LOCATE-PROJECT(1)
2
3
4
6 cargo-locate-project - Print a JSON representation of a Cargo.toml
7 file's location
8
10 cargo locate-project [options]
11
13 This command will print a JSON object to stdout with the full path to
14 the Cargo.toml manifest.
15
17 --workspace
18 Locate the Cargo.toml at the root of the workspace, as opposed to
19 the current workspace member.
20
21 Display Options
22 --message-format fmt
23 The representation in which to print the project location. Valid
24 values:
25
26 • json (default): JSON object with the path under the key "root".
27
28 • plain: Just the path.
29
30 -v, --verbose
31 Use verbose output. May be specified twice for "very verbose"
32 output which includes extra output such as dependency warnings and
33 build script output. May also be specified with the term.verbose
34 config value
35 <https://doc.rust-lang.org/cargo/reference/config.html>.
36
37 -q, --quiet
38 Do not print cargo log messages. May also be specified with the
39 term.quiet config value
40 <https://doc.rust-lang.org/cargo/reference/config.html>.
41
42 --color when
43 Control when colored output is used. Valid values:
44
45 • auto (default): Automatically detect if color support is
46 available on the terminal.
47
48 • always: Always display colors.
49
50 • never: Never display colors.
51
52 May also be specified with the term.color config value
53 <https://doc.rust-lang.org/cargo/reference/config.html>.
54
55 Manifest Options
56 --manifest-path path
57 Path to the Cargo.toml file. By default, Cargo searches for the
58 Cargo.toml file in the current directory or any parent directory.
59
60 Common Options
61 +toolchain
62 If Cargo has been installed with rustup, and the first argument to
63 cargo begins with +, it will be interpreted as a rustup toolchain
64 name (such as +stable or +nightly). See the rustup documentation
65 <https://rust-lang.github.io/rustup/overrides.html> for more
66 information about how toolchain overrides work.
67
68 -h, --help
69 Prints help information.
70
71 -Z flag
72 Unstable (nightly-only) flags to Cargo. Run cargo -Z help for
73 details.
74
76 See the reference
77 <https://doc.rust-lang.org/cargo/reference/environment-variables.html>
78 for details on environment variables that Cargo reads.
79
81 • 0: Cargo succeeded.
82
83 • 101: Cargo failed to complete.
84
86 1. Display the path to the manifest based on the current directory:
87
88 cargo locate-project
89
91 cargo(1), cargo-metadata(1)
92
93
94
95 CARGO-LOCATE-PROJECT(1)