Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Indicate how Cargo locates the manifest #10770

Merged
merged 1 commit into from
Sep 27, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions src/doc/man/cargo-locate-project.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,14 @@ cargo-locate-project - Print a JSON representation of a Cargo.toml file's locati

## DESCRIPTION

This command will print a JSON object to stdout with the full path to the
`Cargo.toml` manifest.
This command will print a JSON object to stdout with the full path to the manifest. The
manifest is found by searching upward for a file named `Cargo.toml` starting from the current
working directory.

If the project happens to be a part of a workspace, the manifest of the project, rather than
the workspace root, is output. This can be overriden by the `--workspace` flag. The root
workspace is found by traversing further upward or by using the field `package.workspace` after
locating the manifest of a workspace member.

## OPTIONS

Expand Down
9 changes: 8 additions & 1 deletion src/doc/man/generated_txt/cargo-locate-project.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,14 @@ SYNOPSIS

DESCRIPTION
This command will print a JSON object to stdout with the full path to
the Cargo.toml manifest.
the manifest. The manifest is found by searching upward for a file named
Cargo.toml starting from the current working directory.

If the project happens to be a part of a workspace, the manifest of the
project, rather than the workspace root, is output. This can be
overriden by the --workspace flag. The root workspace is found by
traversing further upward or by using the field package.workspace after
locating the manifest of a workspace member.

OPTIONS
--workspace
Expand Down
10 changes: 8 additions & 2 deletions src/doc/src/commands/cargo-locate-project.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,14 @@ cargo-locate-project - Print a JSON representation of a Cargo.toml file's locati

## DESCRIPTION

This command will print a JSON object to stdout with the full path to the
`Cargo.toml` manifest.
This command will print a JSON object to stdout with the full path to the manifest. The
manifest is found by searching upward for a file named `Cargo.toml` starting from the current
working directory.

If the project happens to be a part of a workspace, the manifest of the project, rather than
the workspace root, is output. This can be overriden by the `--workspace` flag. The root
workspace is found by traversing further upward or by using the field `package.workspace` after
locating the manifest of a workspace member.

## OPTIONS

Expand Down
5 changes: 4 additions & 1 deletion src/doc/src/reference/manifest.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
## The Manifest Format

The `Cargo.toml` file for each package is called its *manifest*. It is written
in the [TOML] format. Every manifest file consists of the following sections:
in the [TOML] format. It contains metadata that is needed to compile the package. Checkout
the `cargo locate-project` section for more detail on how cargo finds the manifest file.

Every manifest file consists of the following sections:

* [`cargo-features`](unstable.md) — Unstable, nightly-only features.
* [`[package]`](#the-package-section) — Defines a package.
Expand Down
10 changes: 8 additions & 2 deletions src/etc/man/cargo-locate-project.1
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,14 @@ cargo\-locate\-project \- Print a JSON representation of a Cargo.toml file's loc
.SH "SYNOPSIS"
\fBcargo locate\-project\fR [\fIoptions\fR]
.SH "DESCRIPTION"
This command will print a JSON object to stdout with the full path to the
\fBCargo.toml\fR manifest.
This command will print a JSON object to stdout with the full path to the manifest. The
manifest is found by searching upward for a file named \fBCargo.toml\fR starting from the current
working directory.
.sp
If the project happens to be a part of a workspace, the manifest of the project, rather than
the workspace root, is output. This can be overriden by the \fB\-\-workspace\fR flag. The root
workspace is found by traversing further upward or by using the field \fBpackage.workspace\fR after
locating the manifest of a workspace member.
.SH "OPTIONS"
.sp
\fB\-\-workspace\fR
Expand Down