Skip to content

Commit d30fde9

Browse files
committed
Document the new flags in the man page
1 parent 4e051c4 commit d30fde9

File tree

4 files changed

+218
-19
lines changed

4 files changed

+218
-19
lines changed

src/doc/man/cargo-publish.md

Lines changed: 58 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,64 @@ which defaults to `crates-io`.
6868

6969
{{/options}}
7070

71-
{{> section-options-package }}
71+
### Package Selection
72+
73+
By default, when no package selection options are given, the packages selected
74+
depend on the selected manifest file (based on the current working directory if
75+
`--manifest-path` is not given). If the manifest is the root of a workspace then
76+
the workspaces default members are selected, otherwise only the package defined
77+
by the manifest will be selected.
78+
79+
The default members of a workspace can be set explicitly with the
80+
`workspace.default-members` key in the root manifest. If this is not set, a
81+
virtual workspace will include all workspace members (equivalent to passing
82+
`--workspace`), and a non-virtual workspace will include only the root crate itself.
83+
84+
Selecting more than one package is unstable and available only on the
85+
[nightly channel](https://doc.rust-lang.org/book/appendix-07-nightly-rust.html)
86+
and requires the `-Z package-workspace` flag to enable.
87+
See <https://github.com/rust-lang/cargo/issues/10948> for more information.
88+
89+
90+
{{#options}}
91+
92+
{{#option "`-p` _spec_..." "`--package` _spec_..."}}
93+
{{actionverb}} only the specified packages. See {{man "cargo-pkgid" 1}} for the
94+
SPEC format. This flag may be specified multiple times and supports common Unix
95+
glob patterns like `*`, `?` and `[]`. However, to avoid your shell accidentally
96+
expanding glob patterns before Cargo handles them, you must use single quotes or
97+
double quotes around each pattern.
98+
{{/option}}
99+
100+
Selecting more than one package with this option is unstable and available only
101+
on the
102+
[nightly channel](https://doc.rust-lang.org/book/appendix-07-nightly-rust.html)
103+
and requires the `-Z package-workspace` flag to enable.
104+
See <https://github.com/rust-lang/cargo/issues/10948> for more information.
105+
106+
{{#option "`--workspace`" }}
107+
{{actionverb}} all members in the workspace.
108+
109+
This option is unstable and available only on the
110+
[nightly channel](https://doc.rust-lang.org/book/appendix-07-nightly-rust.html)
111+
and requires the `-Z package-workspace` flag to enable.
112+
See <https://github.com/rust-lang/cargo/issues/10948> for more information.
113+
{{/option}}
114+
115+
{{#option "`--exclude` _SPEC_..." }}
116+
Exclude the specified packages. Must be used in conjunction with the
117+
`--workspace` flag. This flag may be specified multiple times and supports
118+
common Unix glob patterns like `*`, `?` and `[]`. However, to avoid your shell
119+
accidentally expanding glob patterns before Cargo handles them, you must use
120+
single quotes or double quotes around each pattern.
121+
122+
This option is unstable and available only on the
123+
[nightly channel](https://doc.rust-lang.org/book/appendix-07-nightly-rust.html)
124+
and requires the `-Z package-workspace` flag to enable.
125+
See <https://github.com/rust-lang/cargo/issues/10948> for more information.
126+
{{/option}}
127+
128+
{{/options}}
72129

73130
### Compilation Options
74131

src/doc/man/generated_txt/cargo-publish.txt

Lines changed: 58 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -72,11 +72,65 @@ OPTIONS
7272
config key which defaults to crates-io.
7373

7474
Package Selection
75-
By default, the package in the current working directory is selected.
76-
The -p flag can be used to choose a different package in a workspace.
75+
By default, when no package selection options are given, the packages
76+
selected depend on the selected manifest file (based on the current
77+
working directory if --manifest-path is not given). If the manifest is
78+
the root of a workspace then the workspaces default members are
79+
selected, otherwise only the package defined by the manifest will be
80+
selected.
7781

78-
-p spec, --package spec
79-
The package to publish. See cargo-pkgid(1) for the SPEC format.
82+
The default members of a workspace can be set explicitly with the
83+
workspace.default-members key in the root manifest. If this is not set,
84+
a virtual workspace will include all workspace members (equivalent to
85+
passing --workspace), and a non-virtual workspace will include only the
86+
root crate itself.
87+
88+
Selecting more than one package is unstable and available only on the
89+
nightly channel
90+
<https://doc.rust-lang.org/book/appendix-07-nightly-rust.html> and
91+
requires the -Z package-workspace flag to enable. See
92+
<https://github.com/rust-lang/cargo/issues/10948> for more information.
93+
94+
-p spec…, --package spec…
95+
Publish only the specified packages. See cargo-pkgid(1) for the SPEC
96+
format. This flag may be specified multiple times and supports
97+
common Unix glob patterns like *, ? and []. However, to avoid your
98+
shell accidentally expanding glob patterns before Cargo handles
99+
them, you must use single quotes or double quotes around each
100+
pattern.
101+
102+
Selecting more than one package with this option is unstable and available only
103+
104+
on the
105+
106+
[nightly channel](https://doc.rust-lang.org/book/appendix-07-nightly-rust.html)
107+
108+
and requires the `-Z package-workspace` flag to enable.
109+
110+
See <https://github.com/rust-lang/cargo/issues/10948> for more information.
111+
112+
--workspace
113+
Publish all members in the workspace.
114+
115+
This option is unstable and available only on the nightly channel
116+
<https://doc.rust-lang.org/book/appendix-07-nightly-rust.html> and
117+
requires the -Z package-workspace flag to enable. See
118+
<https://github.com/rust-lang/cargo/issues/10948> for more
119+
information.
120+
121+
--exclude SPEC…
122+
Exclude the specified packages. Must be used in conjunction with the
123+
--workspace flag. This flag may be specified multiple times and
124+
supports common Unix glob patterns like *, ? and []. However, to
125+
avoid your shell accidentally expanding glob patterns before Cargo
126+
handles them, you must use single quotes or double quotes around
127+
each pattern.
128+
129+
This option is unstable and available only on the nightly channel
130+
<https://doc.rust-lang.org/book/appendix-07-nightly-rust.html> and
131+
requires the -Z package-workspace flag to enable. See
132+
<https://github.com/rust-lang/cargo/issues/10948> for more
133+
information.
80134

81135
Compilation Options
82136
--target triple

src/doc/src/commands/cargo-publish.md

Lines changed: 49 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -77,15 +77,58 @@ which defaults to <code>crates-io</code>.</dd>
7777

7878
### Package Selection
7979

80-
By default, the package in the current working directory is selected. The `-p`
81-
flag can be used to choose a different package in a workspace.
80+
By default, when no package selection options are given, the packages selected
81+
depend on the selected manifest file (based on the current working directory if
82+
`--manifest-path` is not given). If the manifest is the root of a workspace then
83+
the workspaces default members are selected, otherwise only the package defined
84+
by the manifest will be selected.
85+
86+
The default members of a workspace can be set explicitly with the
87+
`workspace.default-members` key in the root manifest. If this is not set, a
88+
virtual workspace will include all workspace members (equivalent to passing
89+
`--workspace`), and a non-virtual workspace will include only the root crate itself.
90+
91+
Selecting more than one package is unstable and available only on the
92+
[nightly channel](https://doc.rust-lang.org/book/appendix-07-nightly-rust.html)
93+
and requires the `-Z package-workspace` flag to enable.
94+
See <https://github.com/rust-lang/cargo/issues/10948> for more information.
95+
8296

8397
<dl>
8498

85-
<dt class="option-term" id="option-cargo-publish--p"><a class="option-anchor" href="#option-cargo-publish--p"></a><code>-p</code> <em>spec</em></dt>
86-
<dt class="option-term" id="option-cargo-publish---package"><a class="option-anchor" href="#option-cargo-publish---package"></a><code>--package</code> <em>spec</em></dt>
87-
<dd class="option-desc">The package to publish. See <a href="cargo-pkgid.html">cargo-pkgid(1)</a> for the SPEC
88-
format.</dd>
99+
<dt class="option-term" id="option-cargo-publish--p"><a class="option-anchor" href="#option-cargo-publish--p"></a><code>-p</code> <em>spec</em>…</dt>
100+
<dt class="option-term" id="option-cargo-publish---package"><a class="option-anchor" href="#option-cargo-publish---package"></a><code>--package</code> <em>spec</em>…</dt>
101+
<dd class="option-desc">Publish only the specified packages. See <a href="cargo-pkgid.html">cargo-pkgid(1)</a> for the
102+
SPEC format. This flag may be specified multiple times and supports common Unix
103+
glob patterns like <code>*</code>, <code>?</code> and <code>[]</code>. However, to avoid your shell accidentally
104+
expanding glob patterns before Cargo handles them, you must use single quotes or
105+
double quotes around each pattern.</dd>
106+
107+
108+
Selecting more than one package with this option is unstable and available only
109+
on the
110+
[nightly channel](https://doc.rust-lang.org/book/appendix-07-nightly-rust.html)
111+
and requires the `-Z package-workspace` flag to enable.
112+
See <https://github.com/rust-lang/cargo/issues/10948> for more information.
113+
114+
<dt class="option-term" id="option-cargo-publish---workspace"><a class="option-anchor" href="#option-cargo-publish---workspace"></a><code>--workspace</code></dt>
115+
<dd class="option-desc">Publish all members in the workspace.</p>
116+
<p>This option is unstable and available only on the
117+
<a href="https://doc.rust-lang.org/book/appendix-07-nightly-rust.html">nightly channel</a>
118+
and requires the <code>-Z package-workspace</code> flag to enable.
119+
See <a href="https://github.com/rust-lang/cargo/issues/10948">https://github.com/rust-lang/cargo/issues/10948</a> for more information.</dd>
120+
121+
122+
<dt class="option-term" id="option-cargo-publish---exclude"><a class="option-anchor" href="#option-cargo-publish---exclude"></a><code>--exclude</code> <em>SPEC</em>…</dt>
123+
<dd class="option-desc">Exclude the specified packages. Must be used in conjunction with the
124+
<code>--workspace</code> flag. This flag may be specified multiple times and supports
125+
common Unix glob patterns like <code>*</code>, <code>?</code> and <code>[]</code>. However, to avoid your shell
126+
accidentally expanding glob patterns before Cargo handles them, you must use
127+
single quotes or double quotes around each pattern.</p>
128+
<p>This option is unstable and available only on the
129+
<a href="https://doc.rust-lang.org/book/appendix-07-nightly-rust.html">nightly channel</a>
130+
and requires the <code>-Z package-workspace</code> flag to enable.
131+
See <a href="https://github.com/rust-lang/cargo/issues/10948">https://github.com/rust-lang/cargo/issues/10948</a> for more information.</dd>
89132

90133

91134
</dl>

src/etc/man/cargo-publish.1

Lines changed: 53 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -89,14 +89,59 @@ Otherwise it will use the default registry, which is defined by the
8989
which defaults to \fBcrates\-io\fR\&.
9090
.RE
9191
.SS "Package Selection"
92-
By default, the package in the current working directory is selected. The \fB\-p\fR
93-
flag can be used to choose a different package in a workspace.
94-
.sp
95-
\fB\-p\fR \fIspec\fR,
96-
\fB\-\-package\fR \fIspec\fR
97-
.RS 4
98-
The package to publish. See \fBcargo\-pkgid\fR(1) for the SPEC
99-
format.
92+
By default, when no package selection options are given, the packages selected
93+
depend on the selected manifest file (based on the current working directory if
94+
\fB\-\-manifest\-path\fR is not given). If the manifest is the root of a workspace then
95+
the workspaces default members are selected, otherwise only the package defined
96+
by the manifest will be selected.
97+
.sp
98+
The default members of a workspace can be set explicitly with the
99+
\fBworkspace.default\-members\fR key in the root manifest. If this is not set, a
100+
virtual workspace will include all workspace members (equivalent to passing
101+
\fB\-\-workspace\fR), and a non\-virtual workspace will include only the root crate itself.
102+
.sp
103+
Selecting more than one package is unstable and available only on the
104+
\fInightly channel\fR <https://doc.rust\-lang.org/book/appendix\-07\-nightly\-rust.html>
105+
and requires the \fB\-Z package\-workspace\fR flag to enable.
106+
See <https://github.com/rust\-lang/cargo/issues/10948> for more information.
107+
.sp
108+
\fB\-p\fR \fIspec\fR\[u2026],
109+
\fB\-\-package\fR \fIspec\fR\[u2026]
110+
.RS 4
111+
Publish only the specified packages. See \fBcargo\-pkgid\fR(1) for the
112+
SPEC format. This flag may be specified multiple times and supports common Unix
113+
glob patterns like \fB*\fR, \fB?\fR and \fB[]\fR\&. However, to avoid your shell accidentally
114+
expanding glob patterns before Cargo handles them, you must use single quotes or
115+
double quotes around each pattern.
116+
.RE
117+
Selecting more than one package with this option is unstable and available only
118+
on the
119+
[nightly channel](https://doc.rust-lang.org/book/appendix-07-nightly-rust.html)
120+
and requires the `-Z package-workspace` flag to enable.
121+
See <https://github.com/rust-lang/cargo/issues/10948> for more information.
122+
.sp
123+
\fB\-\-workspace\fR
124+
.RS 4
125+
Publish all members in the workspace.
126+
.sp
127+
This option is unstable and available only on the
128+
\fInightly channel\fR <https://doc.rust\-lang.org/book/appendix\-07\-nightly\-rust.html>
129+
and requires the \fB\-Z package\-workspace\fR flag to enable.
130+
See <https://github.com/rust\-lang/cargo/issues/10948> for more information.
131+
.RE
132+
.sp
133+
\fB\-\-exclude\fR \fISPEC\fR\[u2026]
134+
.RS 4
135+
Exclude the specified packages. Must be used in conjunction with the
136+
\fB\-\-workspace\fR flag. This flag may be specified multiple times and supports
137+
common Unix glob patterns like \fB*\fR, \fB?\fR and \fB[]\fR\&. However, to avoid your shell
138+
accidentally expanding glob patterns before Cargo handles them, you must use
139+
single quotes or double quotes around each pattern.
140+
.sp
141+
This option is unstable and available only on the
142+
\fInightly channel\fR <https://doc.rust\-lang.org/book/appendix\-07\-nightly\-rust.html>
143+
and requires the \fB\-Z package\-workspace\fR flag to enable.
144+
See <https://github.com/rust\-lang/cargo/issues/10948> for more information.
100145
.RE
101146
.SS "Compilation Options"
102147
.sp

0 commit comments

Comments
 (0)