Skip to content

Commit d1e72bc

Browse files
committed
fix: also build manpage for cargo.md
1 parent 257b72b commit d1e72bc

File tree

4 files changed

+47
-31
lines changed

4 files changed

+47
-31
lines changed

crates/xtask-build-man/src/main.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,14 +45,14 @@ fn build_mdman() -> io::Result<()> {
4545
/// saved in the src/doc/src/commands/ directory. These are included in the
4646
/// Cargo book, which is converted to HTML by mdbook.
4747
fn build_cargo() -> io::Result<()> {
48-
// Find all `src/doc/man/cargo-*.md`
48+
// Find all `src/doc/man/cargo*.md`
4949
let src_paths = {
5050
let mut src_paths = Vec::new();
5151
for entry in fs::read_dir("src/doc/man")? {
5252
let entry = entry?;
5353
let file_name = entry.file_name();
5454
let file_name = file_name.to_str().unwrap();
55-
if file_name.starts_with("cargo-") && file_name.ends_with(".md") {
55+
if file_name.starts_with("cargo") && file_name.ends_with(".md") {
5656
src_paths.push(entry.path());
5757
}
5858
}

src/doc/man/generated_txt/cargo.txt

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -158,16 +158,19 @@ OPTIONS
158158
<https://doc.rust-lang.org/cargo/reference/config.html>.
159159

160160
Manifest Options
161-
--frozen, --locked
162-
Either of these flags requires that the Cargo.lock file is
163-
up-to-date. If the lock file is missing, or it needs to be updated,
164-
Cargo will exit with an error. The --frozen flag also prevents Cargo
165-
from attempting to access the network to determine if it is
166-
out-of-date.
161+
--locked
162+
Asserts that the exact same dependencies and versions are used as
163+
when the existing Cargo.lock file was originally generated. Cargo
164+
will exit with an error when either of the following scenarios
165+
arises:
167166

168-
These may be used in environments where you want to assert that the
169-
Cargo.lock file is up-to-date (such as a CI build) or want to avoid
170-
network access.
167+
o The lock file is missing.
168+
169+
o Cargo attempted to change the lock file due to a different
170+
dependency resolution.
171+
172+
It may be used in environments where deterministic builds are
173+
desired, such as in CI pipelines.
171174

172175
--offline
173176
Prevents Cargo from accessing the network for any reason. Without
@@ -184,6 +187,9 @@ OPTIONS
184187
May also be specified with the net.offline config value
185188
<https://doc.rust-lang.org/cargo/reference/config.html>.
186189

190+
--frozen
191+
Equivalent to specifying both --locked and --offline.
192+
187193
Common Options
188194
+toolchain
189195
If Cargo has been installed with rustup, and the first argument to

src/doc/src/commands/cargo.md

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -180,21 +180,21 @@ terminal.</li>
180180
<a href="../reference/config.html">config value</a>.</dd>
181181

182182

183-
184183
</dl>
185184

186185
### Manifest Options
187186

188187
<dl>
189-
<dt class="option-term" id="option-cargo---frozen"><a class="option-anchor" href="#option-cargo---frozen"></a><code>--frozen</code></dt>
190188
<dt class="option-term" id="option-cargo---locked"><a class="option-anchor" href="#option-cargo---locked"></a><code>--locked</code></dt>
191-
<dd class="option-desc">Either of these flags requires that the <code>Cargo.lock</code> file is
192-
up-to-date. If the lock file is missing, or it needs to be updated, Cargo will
193-
exit with an error. The <code>--frozen</code> flag also prevents Cargo from
194-
attempting to access the network to determine if it is out-of-date.</p>
195-
<p>These may be used in environments where you want to assert that the
196-
<code>Cargo.lock</code> file is up-to-date (such as a CI build) or want to avoid network
197-
access.</dd>
189+
<dd class="option-desc">Asserts that the exact same dependencies and versions are used as when the
190+
existing <code>Cargo.lock</code> file was originally generated. Cargo will exit with an
191+
error when either of the following scenarios arises:</p>
192+
<ul>
193+
<li>The lock file is missing.</li>
194+
<li>Cargo attempted to change the lock file due to a different dependency resolution.</li>
195+
</ul>
196+
<p>It may be used in environments where deterministic builds are desired,
197+
such as in CI pipelines.</dd>
198198

199199

200200
<dt class="option-term" id="option-cargo---offline"><a class="option-anchor" href="#option-cargo---offline"></a><code>--offline</code></dt>
@@ -210,6 +210,9 @@ offline.</p>
210210
<p>May also be specified with the <code>net.offline</code> <a href="../reference/config.html">config value</a>.</dd>
211211

212212

213+
<dt class="option-term" id="option-cargo---frozen"><a class="option-anchor" href="#option-cargo---frozen"></a><code>--frozen</code></dt>
214+
<dd class="option-desc">Equivalent to specifying both <code>--locked</code> and <code>--offline</code>.</dd>
215+
213216
</dl>
214217

215218
### Common Options
@@ -252,19 +255,16 @@ requires the <code>-Z unstable-options</code> flag to enable (see
252255

253256
</dl>
254257

255-
256258
## ENVIRONMENT
257259

258260
See [the reference](../reference/environment-variables.html) for
259261
details on environment variables that Cargo reads.
260262

261-
262263
## EXIT STATUS
263264

264265
* `0`: Cargo succeeded.
265266
* `101`: Cargo failed to complete.
266267

267-
268268
## FILES
269269

270270
`~/.cargo/`\

src/etc/man/cargo.1

Lines changed: 18 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -209,17 +209,22 @@ May also be specified with the \fBterm.color\fR
209209
.RE
210210
.SS "Manifest Options"
211211
.sp
212-
\fB\-\-frozen\fR,
213212
\fB\-\-locked\fR
214213
.RS 4
215-
Either of these flags requires that the \fBCargo.lock\fR file is
216-
up\-to\-date. If the lock file is missing, or it needs to be updated, Cargo will
217-
exit with an error. The \fB\-\-frozen\fR flag also prevents Cargo from
218-
attempting to access the network to determine if it is out\-of\-date.
214+
Asserts that the exact same dependencies and versions are used as when the
215+
existing \fBCargo.lock\fR file was originally generated. Cargo will exit with an
216+
error when either of the following scenarios arises:
219217
.sp
220-
These may be used in environments where you want to assert that the
221-
\fBCargo.lock\fR file is up\-to\-date (such as a CI build) or want to avoid network
222-
access.
218+
.RS 4
219+
\h'-04'\(bu\h'+02'The lock file is missing.
220+
.RE
221+
.sp
222+
.RS 4
223+
\h'-04'\(bu\h'+02'Cargo attempted to change the lock file due to a different dependency resolution.
224+
.RE
225+
.sp
226+
It may be used in environments where deterministic builds are desired,
227+
such as in CI pipelines.
223228
.RE
224229
.sp
225230
\fB\-\-offline\fR
@@ -237,6 +242,11 @@ offline.
237242
.sp
238243
May also be specified with the \fBnet.offline\fR \fIconfig value\fR <https://doc.rust\-lang.org/cargo/reference/config.html>\&.
239244
.RE
245+
.sp
246+
\fB\-\-frozen\fR
247+
.RS 4
248+
Equivalent to specifying both \fB\-\-locked\fR and \fB\-\-offline\fR\&.
249+
.RE
240250
.SS "Common Options"
241251
.sp
242252
\fB+\fR\fItoolchain\fR

0 commit comments

Comments
 (0)