.arg(
opt(
"filter-platform",
- "Only include resolve dependencies matching the given target-triple \
- (\"host\" for current host)",
+ "Only include resolve dependencies matching the given target-triple",
)
.value_name("TRIPLE"),
)
})
}
+/// This is the structure that is serialized and displayed to the user.
+///
+/// See cargo-metadata.adoc for detailed documentation of the format.
#[derive(Serialize)]
pub struct ExportInfo {
packages: Vec<Package>,
pkg: PackageId,
}
+/// Builds the resolve graph as it will be displayed to the user.
fn build_resolve_graph(
ws: &Workspace<'_>,
resolve_opts: ResolveOpts,
/* The resolved dependency graph, with the concrete versions and features
selected. The set depends on the enabled features.
This is null if --no-deps is specified.
+ By default, this includes all dependencies for all target platforms.
+ The `--filter-platform` flag may be used to narrow to a specific
+ target triple.
*/
"resolve": {
/* Array of nodes within the dependency graph.
Specify the version of the output format to use. Currently `1` is the only
possible value.
+*--filter-platform* _TRIPLE_::
+ This filters the `resolve` output to only include dependencies for the
+ given target triple. Without this flag, the resolve includes all targets.
++
+Note that the dependencies listed in the "packages" array still includes all
+dependencies. Each package definition is intended to be an unaltered
+reproduction of the information within `Cargo.toml`.
+
include::options-features.adoc[]
=== Display Options
/* The resolved dependency graph, with the concrete versions and features
selected. The set depends on the enabled features.
This is null if --no-deps is specified.
+ By default, this includes all dependencies for all target platforms.
+ The `--filter-platform` flag may be used to narrow to a specific
+ target triple.
*/
"resolve": {
/* Array of nodes within the dependency graph.
<p>Specify the version of the output format to use. Currently <code>1</code> is the only
possible value.</p>
</dd>
+<dt class="hdlist1"><strong>--filter-platform</strong> <em>TRIPLE</em></dt>
+<dd>
+<p>This filters the <code>resolve</code> output to only include dependencies for the
+given target triple. Without this flag, the resolve includes all targets.</p>
+<div class="paragraph">
+<p>Note that the dependencies listed in the "packages" array still includes all
+dependencies. Each package definition is intended to be an unaltered
+reproduction of the information within <code>Cargo.toml</code>.</p>
+</div>
+</dd>
</dl>
</div>
</div>
.\" Title: cargo-metadata
.\" Author: [see the "AUTHOR(S)" section]
.\" Generator: Asciidoctor 2.0.10
-.\" Date: 2019-09-17
+.\" Date: 2019-10-28
.\" Manual: \ \&
.\" Source: \ \&
.\" Language: English
.\"
-.TH "CARGO\-METADATA" "1" "2019-09-17" "\ \&" "\ \&"
+.TH "CARGO\-METADATA" "1" "2019-10-28" "\ \&" "\ \&"
.ie \n(.g .ds Aq \(aq
.el .ds Aq '
.ss \n[.ss] 0
/* The resolved dependency graph, with the concrete versions and features
selected. The set depends on the enabled features.
This is null if \-\-no\-deps is specified.
+ By default, this includes all dependencies for all target platforms.
+ The `\-\-filter\-platform` flag may be used to narrow to a specific
+ target triple.
*/
"resolve": {
/* Array of nodes within the dependency graph.
Specify the version of the output format to use. Currently \fB1\fP is the only
possible value.
.RE
+.sp
+\fB\-\-filter\-platform\fP \fITRIPLE\fP
+.RS 4
+This filters the \fBresolve\fP output to only include dependencies for the
+given target triple. Without this flag, the resolve includes all targets.
+.sp
+Note that the dependencies listed in the "packages" array still includes all
+dependencies. Each package definition is intended to be an unaltered
+reproduction of the information within \fBCargo.toml\fP.
+.RE
.SS "Feature Selection"
.sp
When no feature options are given, the \fBdefault\fP feature is activated for