LinuxCommandLibrary
GitHubF-DroidGoogle Play Store

cargo-locate-project

Print the path to a project's Cargo.toml

TLDR

Show manifest path
$ cargo locate-project
copy
Show workspace root manifest
$ cargo locate-project --workspace
copy
Output as plain path
$ cargo locate-project --message-format plain
copy
Output as JSON
$ cargo locate-project --message-format json
copy
Locate project from a specific directory
$ cargo locate-project --manifest-path [path/to/Cargo.toml]
copy

SYNOPSIS

cargo locate-project [options]

DESCRIPTION

cargo locate-project prints the path to the Cargo.toml manifest file for the current package. Searches current directory and parent directories for the manifest.

PARAMETERS

--workspace

Locate workspace root Cargo.toml instead of current package
--message-format format
Output format: json (default), plain
--manifest-path path
Path to Cargo.toml
-v, --verbose
Verbose output
-q, --quiet
Suppress log messages
--color WHEN
Control color output: auto, always, never

OUTPUT

JSON format (default)

$ {"root":"/path/to/project/Cargo.toml"}
copy
Plain format
$ /path/to/project/Cargo.toml
copy

EXIT STATUS

0

Success
101
Failed to locate manifest

INSTALL

sudo apt install cargo
copy
sudo dnf install cargo
copy
sudo apk add cargo
copy
sudo zypper install cargo
copy
nix profile install nixpkgs#cargo
copy

CAVEATS

Useful for scripts and tooling that need to find the project root. Returns exit code 101 if no Cargo.toml is found in the current or any parent directory.

SEE ALSO

Braincup
Open source brain training for math, memory and focus
Braincup mini-games
41 mini-games · Apache-2.0
No ads · No tracking
Play in browser
Download Braincup on the App StoreGet Braincup on Google PlayGet Braincup on F-Droid
276 stars
From the maker of Linux Command Library
Copied to clipboard
Braincup
Open source brain training for math, memory and focus. 41 mini-games, from mental arithmetic to Sudoku, N-Back and Solo Chess.
Apache-2.0 licensed · No ads · No tracking · No account
From the maker of Linux Command Library
Download Braincup on the App StoreGet Braincup on Google PlayGet Braincup on F-Droid