From 3099685d98f56d985001e7175c4c1ce4188dbb5d Mon Sep 17 00:00:00 2001 From: Eric Huss Date: Mon, 24 Feb 2020 17:58:44 -0800 Subject: [PATCH] Try to clarify `cargo metadata`'s relationship with the workspace. --- src/bin/cargo/commands/metadata.rs | 2 +- src/doc/man/cargo-metadata.adoc | 9 +++++---- src/doc/man/generated/cargo-metadata.html | 9 +++++---- src/etc/man/cargo-metadata.1 | 13 +++++++------ 4 files changed, 18 insertions(+), 15 deletions(-) diff --git a/src/bin/cargo/commands/metadata.rs b/src/bin/cargo/commands/metadata.rs index 68eb6cad48a..9ac181c861f 100644 --- a/src/bin/cargo/commands/metadata.rs +++ b/src/bin/cargo/commands/metadata.rs @@ -21,7 +21,7 @@ pub fn cli() -> App { ) .arg(opt( "no-deps", - "Output information only about the root package \ + "Output information only about the workspace members \ and don't fetch dependencies", )) .arg_manifest_path() diff --git a/src/doc/man/cargo-metadata.adoc b/src/doc/man/cargo-metadata.adoc index cb5bfb579c7..28c09c881af 100644 --- a/src/doc/man/cargo-metadata.adoc +++ b/src/doc/man/cargo-metadata.adoc @@ -13,8 +13,8 @@ cargo-metadata - Machine-readable metadata about the current package == DESCRIPTION -Output the resolved dependencies of a package, the concrete used versions -including overrides, in JSON to stdout. +Output JSON to stdout containing information about the workspace members and +resolved dependencies of the current package. It is recommended to include the `--format-version` flag to future-proof your code to ensure the output is in the format you are expecting. @@ -199,8 +199,9 @@ The output has the following format: "workspace_members": [ "my-package 0.1.0 (path+file:///path/to/my-package)", ], - // The resolved dependency graph, with the concrete versions and features - // selected. The set depends on the enabled features. + // The resolved dependency graph for the entire workspace. The enabled + // features are based on the enabled features for the "current" package. + // Inactivated optional dependencies are not listed. // // This is null if --no-deps is specified. // diff --git a/src/doc/man/generated/cargo-metadata.html b/src/doc/man/generated/cargo-metadata.html index 51405638d79..239de281226 100644 --- a/src/doc/man/generated/cargo-metadata.html +++ b/src/doc/man/generated/cargo-metadata.html @@ -14,8 +14,8 @@

SYNOPSIS

DESCRIPTION

-

Output the resolved dependencies of a package, the concrete used versions -including overrides, in JSON to stdout.

+

Output JSON to stdout containing information about the workspace members and +resolved dependencies of the current package.

It is recommended to include the --format-version flag to future-proof @@ -206,8 +206,9 @@

OUTPUT FORMAT

"workspace_members": [ "my-package 0.1.0 (path+file:///path/to/my-package)", ], - // The resolved dependency graph, with the concrete versions and features - // selected. The set depends on the enabled features. + // The resolved dependency graph for the entire workspace. The enabled + // features are based on the enabled features for the "current" package. + // Inactivated optional dependencies are not listed. // // This is null if --no-deps is specified. // diff --git a/src/etc/man/cargo-metadata.1 b/src/etc/man/cargo-metadata.1 index 2529f686ade..4968fb7b279 100644 --- a/src/etc/man/cargo-metadata.1 +++ b/src/etc/man/cargo-metadata.1 @@ -2,12 +2,12 @@ .\" Title: cargo-metadata .\" Author: [see the "AUTHOR(S)" section] .\" Generator: Asciidoctor 2.0.10 -.\" Date: 2019-12-05 +.\" Date: 2020-02-24 .\" Manual: \ \& .\" Source: \ \& .\" Language: English .\" -.TH "CARGO\-METADATA" "1" "2019-12-05" "\ \&" "\ \&" +.TH "CARGO\-METADATA" "1" "2020-02-24" "\ \&" "\ \&" .ie \n(.g .ds Aq \(aq .el .ds Aq ' .ss \n[.ss] 0 @@ -34,8 +34,8 @@ cargo\-metadata \- Machine\-readable metadata about the current package \fBcargo metadata [\fIOPTIONS\fP]\fP .SH "DESCRIPTION" .sp -Output the resolved dependencies of a package, the concrete used versions -including overrides, in JSON to stdout. +Output JSON to stdout containing information about the workspace members and +resolved dependencies of the current package. .sp It is recommended to include the \fB\-\-format\-version\fP flag to future\-proof your code to ensure the output is in the format you are expecting. @@ -220,8 +220,9 @@ The output has the following format: "workspace_members": [ "my\-package 0.1.0 (path+file:///path/to/my\-package)", ], - // The resolved dependency graph, with the concrete versions and features - // selected. The set depends on the enabled features. + // The resolved dependency graph for the entire workspace. The enabled + // features are based on the enabled features for the "current" package. + // Inactivated optional dependencies are not listed. // // This is null if \-\-no\-deps is specified. //