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 No output printed to stdout.
39
40 --color when
41 Control when colored output is used. Valid values:
42
43 · auto (default): Automatically detect if color support is
44 available on the terminal.
45
46 · always: Always display colors.
47
48 · never: Never display colors.
49
50 May also be specified with the term.color config value
51 <https://doc.rust-lang.org/cargo/reference/config.html>.
52
53 Manifest Options
54 --manifest-path path
55 Path to the Cargo.toml file. By default, Cargo searches for the
56 Cargo.toml file in the current directory or any parent directory.
57
58 Common Options
59 +toolchain
60 If Cargo has been installed with rustup, and the first argument to
61 cargo begins with +, it will be interpreted as a rustup toolchain
62 name (such as +stable or +nightly). See the rustup documentation
63 <https://rust-lang.github.io/rustup/overrides.html> for more
64 information about how toolchain overrides work.
65
66 -h, --help
67 Prints help information.
68
69 -Z flag
70 Unstable (nightly-only) flags to Cargo. Run cargo -Z help for
71 details.
72
74 See the reference
75 <https://doc.rust-lang.org/cargo/reference/environment-variables.html>
76 for details on environment variables that Cargo reads.
77
79 · 0: Cargo succeeded.
80
81 · 101: Cargo failed to complete.
82
84 1. Display the path to the manifest based on the current directory:
85
86 cargo locate-project
87
89 cargo(1), cargo-metadata(1)
90
91
92
93 CARGO-LOCATE-PROJECT(1)