Skip to content

Commit e549bc8

Browse files
committed
fix(cli): resolve confusion between --frozen and --locked
1 parent 07253b7 commit e549bc8

File tree

109 files changed

+799
-705
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

109 files changed

+799
-705
lines changed

src/bin/cargo/cli.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -640,17 +640,17 @@ See '<cyan,bold>cargo help</> <cyan><<command>></>' for more information on a sp
640640
.value_parser(clap::builder::ValueParser::path_buf()),
641641
)
642642
.arg(
643-
flag("frozen", "Require Cargo.lock and cache to be up-to-date")
643+
flag("locked", "Require Cargo.lock to be up-to-date")
644644
.help_heading(heading::MANIFEST_OPTIONS)
645645
.global(true),
646646
)
647647
.arg(
648-
flag("locked", "Require Cargo.lock to be up-to-date")
648+
flag("offline", "Run without accessing the network")
649649
.help_heading(heading::MANIFEST_OPTIONS)
650650
.global(true),
651651
)
652652
.arg(
653-
flag("offline", "Run without accessing the network")
653+
flag("frozen", "Equivalent to specifying both --locked and --offline")
654654
.help_heading(heading::MANIFEST_OPTIONS)
655655
.global(true),
656656
)

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

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -171,16 +171,14 @@ OPTIONS
171171
-p spec, --package spec
172172
Add dependencies to only the specified package.
173173

174-
--frozen, --locked
175-
Either of these flags requires that the Cargo.lock file be
176-
up-to-date. If the lock file is missing, or it needs to be updated,
177-
Cargo will exit with an error. The --frozen flag also prevents Cargo
178-
from attempting to access the network to determine if it is
179-
out-of-date.
174+
--locked
175+
Requires the Cargo.lock file be up-to-date. If the lock file is
176+
missing, or it needs to be updated due to changes in the Cargo.toml
177+
file, for example a new dependency is added, Cargo will exit with an
178+
error.
180179

181-
These may be used in environments where you want to assert that the
182-
Cargo.lock file is up-to-date (such as a CI build) or want to avoid
183-
network access.
180+
It may be used in environments where you want to assert that the
181+
Cargo.lock file is up-to-date (such as a CI build).
184182

185183
--offline
186184
Prevents Cargo from accessing the network for any reason. Without
@@ -197,6 +195,9 @@ OPTIONS
197195
May also be specified with the net.offline config value
198196
<https://doc.rust-lang.org/cargo/reference/config.html>.
199197

198+
--frozen
199+
Equivalent to specifying both --locked and --offline.
200+
200201
Common Options
201202
+toolchain
202203
If Cargo has been installed with rustup, and the first argument to

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

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -338,16 +338,14 @@ OPTIONS
338338
Path to the Cargo.toml file. By default, Cargo searches for the
339339
Cargo.toml file in the current directory or any parent directory.
340340

341-
--frozen, --locked
342-
Either of these flags requires that the Cargo.lock file be
343-
up-to-date. If the lock file is missing, or it needs to be updated,
344-
Cargo will exit with an error. The --frozen flag also prevents Cargo
345-
from attempting to access the network to determine if it is
346-
out-of-date.
341+
--locked
342+
Requires the Cargo.lock file be up-to-date. If the lock file is
343+
missing, or it needs to be updated due to changes in the Cargo.toml
344+
file, for example a new dependency is added, Cargo will exit with an
345+
error.
347346

348-
These may be used in environments where you want to assert that the
349-
Cargo.lock file is up-to-date (such as a CI build) or want to avoid
350-
network access.
347+
It may be used in environments where you want to assert that the
348+
Cargo.lock file is up-to-date (such as a CI build).
351349

352350
--offline
353351
Prevents Cargo from accessing the network for any reason. Without
@@ -364,6 +362,9 @@ OPTIONS
364362
May also be specified with the net.offline config value
365363
<https://doc.rust-lang.org/cargo/reference/config.html>.
366364

365+
--frozen
366+
Equivalent to specifying both --locked and --offline.
367+
367368
Common Options
368369
+toolchain
369370
If Cargo has been installed with rustup, and the first argument to

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

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -272,16 +272,14 @@ OPTIONS
272272
Path to the Cargo.toml file. By default, Cargo searches for the
273273
Cargo.toml file in the current directory or any parent directory.
274274

275-
--frozen, --locked
276-
Either of these flags requires that the Cargo.lock file be
277-
up-to-date. If the lock file is missing, or it needs to be updated,
278-
Cargo will exit with an error. The --frozen flag also prevents Cargo
279-
from attempting to access the network to determine if it is
280-
out-of-date.
275+
--locked
276+
Requires the Cargo.lock file be up-to-date. If the lock file is
277+
missing, or it needs to be updated due to changes in the Cargo.toml
278+
file, for example a new dependency is added, Cargo will exit with an
279+
error.
281280

282-
These may be used in environments where you want to assert that the
283-
Cargo.lock file is up-to-date (such as a CI build) or want to avoid
284-
network access.
281+
It may be used in environments where you want to assert that the
282+
Cargo.lock file is up-to-date (such as a CI build).
285283

286284
--offline
287285
Prevents Cargo from accessing the network for any reason. Without
@@ -298,6 +296,9 @@ OPTIONS
298296
May also be specified with the net.offline config value
299297
<https://doc.rust-lang.org/cargo/reference/config.html>.
300298

299+
--frozen
300+
Equivalent to specifying both --locked and --offline.
301+
301302
Common Options
302303
+toolchain
303304
If Cargo has been installed with rustup, and the first argument to

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

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -257,16 +257,14 @@ OPTIONS
257257
Path to the Cargo.toml file. By default, Cargo searches for the
258258
Cargo.toml file in the current directory or any parent directory.
259259

260-
--frozen, --locked
261-
Either of these flags requires that the Cargo.lock file be
262-
up-to-date. If the lock file is missing, or it needs to be updated,
263-
Cargo will exit with an error. The --frozen flag also prevents Cargo
264-
from attempting to access the network to determine if it is
265-
out-of-date.
260+
--locked
261+
Requires the Cargo.lock file be up-to-date. If the lock file is
262+
missing, or it needs to be updated due to changes in the Cargo.toml
263+
file, for example a new dependency is added, Cargo will exit with an
264+
error.
266265

267-
These may be used in environments where you want to assert that the
268-
Cargo.lock file is up-to-date (such as a CI build) or want to avoid
269-
network access.
266+
It may be used in environments where you want to assert that the
267+
Cargo.lock file is up-to-date (such as a CI build).
270268

271269
--offline
272270
Prevents Cargo from accessing the network for any reason. Without
@@ -283,6 +281,9 @@ OPTIONS
283281
May also be specified with the net.offline config value
284282
<https://doc.rust-lang.org/cargo/reference/config.html>.
285283

284+
--frozen
285+
Equivalent to specifying both --locked and --offline.
286+
286287
Common Options
287288
+toolchain
288289
If Cargo has been installed with rustup, and the first argument to

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

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -91,16 +91,14 @@ OPTIONS
9191
Path to the Cargo.toml file. By default, Cargo searches for the
9292
Cargo.toml file in the current directory or any parent directory.
9393

94-
--frozen, --locked
95-
Either of these flags requires that the Cargo.lock file be
96-
up-to-date. If the lock file is missing, or it needs to be updated,
97-
Cargo will exit with an error. The --frozen flag also prevents Cargo
98-
from attempting to access the network to determine if it is
99-
out-of-date.
94+
--locked
95+
Requires the Cargo.lock file be up-to-date. If the lock file is
96+
missing, or it needs to be updated due to changes in the Cargo.toml
97+
file, for example a new dependency is added, Cargo will exit with an
98+
error.
10099

101-
These may be used in environments where you want to assert that the
102-
Cargo.lock file is up-to-date (such as a CI build) or want to avoid
103-
network access.
100+
It may be used in environments where you want to assert that the
101+
Cargo.lock file is up-to-date (such as a CI build).
104102

105103
--offline
106104
Prevents Cargo from accessing the network for any reason. Without
@@ -117,6 +115,9 @@ OPTIONS
117115
May also be specified with the net.offline config value
118116
<https://doc.rust-lang.org/cargo/reference/config.html>.
119117

118+
--frozen
119+
Equivalent to specifying both --locked and --offline.
120+
120121
Common Options
121122
+toolchain
122123
If Cargo has been installed with rustup, and the first argument to

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

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -228,16 +228,14 @@ OPTIONS
228228
Path to the Cargo.toml file. By default, Cargo searches for the
229229
Cargo.toml file in the current directory or any parent directory.
230230

231-
--frozen, --locked
232-
Either of these flags requires that the Cargo.lock file be
233-
up-to-date. If the lock file is missing, or it needs to be updated,
234-
Cargo will exit with an error. The --frozen flag also prevents Cargo
235-
from attempting to access the network to determine if it is
236-
out-of-date.
231+
--locked
232+
Requires the Cargo.lock file be up-to-date. If the lock file is
233+
missing, or it needs to be updated due to changes in the Cargo.toml
234+
file, for example a new dependency is added, Cargo will exit with an
235+
error.
237236

238-
These may be used in environments where you want to assert that the
239-
Cargo.lock file is up-to-date (such as a CI build) or want to avoid
240-
network access.
237+
It may be used in environments where you want to assert that the
238+
Cargo.lock file is up-to-date (such as a CI build).
241239

242240
--offline
243241
Prevents Cargo from accessing the network for any reason. Without
@@ -254,6 +252,9 @@ OPTIONS
254252
May also be specified with the net.offline config value
255253
<https://doc.rust-lang.org/cargo/reference/config.html>.
256254

255+
--frozen
256+
Equivalent to specifying both --locked and --offline.
257+
257258
Common Options
258259
+toolchain
259260
If Cargo has been installed with rustup, and the first argument to

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

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -71,16 +71,14 @@ OPTIONS
7171
Path to the Cargo.toml file. By default, Cargo searches for the
7272
Cargo.toml file in the current directory or any parent directory.
7373

74-
--frozen, --locked
75-
Either of these flags requires that the Cargo.lock file be
76-
up-to-date. If the lock file is missing, or it needs to be updated,
77-
Cargo will exit with an error. The --frozen flag also prevents Cargo
78-
from attempting to access the network to determine if it is
79-
out-of-date.
74+
--locked
75+
Requires the Cargo.lock file be up-to-date. If the lock file is
76+
missing, or it needs to be updated due to changes in the Cargo.toml
77+
file, for example a new dependency is added, Cargo will exit with an
78+
error.
8079

81-
These may be used in environments where you want to assert that the
82-
Cargo.lock file is up-to-date (such as a CI build) or want to avoid
83-
network access.
80+
It may be used in environments where you want to assert that the
81+
Cargo.lock file is up-to-date (such as a CI build).
8482

8583
--offline
8684
Prevents Cargo from accessing the network for any reason. Without
@@ -96,6 +94,9 @@ OPTIONS
9694
May also be specified with the net.offline config value
9795
<https://doc.rust-lang.org/cargo/reference/config.html>.
9896

97+
--frozen
98+
Equivalent to specifying both --locked and --offline.
99+
99100
Common Options
100101
+toolchain
101102
If Cargo has been installed with rustup, and the first argument to

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

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -330,16 +330,14 @@ OPTIONS
330330
Path to the Cargo.toml file. By default, Cargo searches for the
331331
Cargo.toml file in the current directory or any parent directory.
332332

333-
--frozen, --locked
334-
Either of these flags requires that the Cargo.lock file be
335-
up-to-date. If the lock file is missing, or it needs to be updated,
336-
Cargo will exit with an error. The --frozen flag also prevents Cargo
337-
from attempting to access the network to determine if it is
338-
out-of-date.
333+
--locked
334+
Requires the Cargo.lock file be up-to-date. If the lock file is
335+
missing, or it needs to be updated due to changes in the Cargo.toml
336+
file, for example a new dependency is added, Cargo will exit with an
337+
error.
339338

340-
These may be used in environments where you want to assert that the
341-
Cargo.lock file is up-to-date (such as a CI build) or want to avoid
342-
network access.
339+
It may be used in environments where you want to assert that the
340+
Cargo.lock file is up-to-date (such as a CI build).
343341

344342
--offline
345343
Prevents Cargo from accessing the network for any reason. Without
@@ -356,6 +354,9 @@ OPTIONS
356354
May also be specified with the net.offline config value
357355
<https://doc.rust-lang.org/cargo/reference/config.html>.
358356

357+
--frozen
358+
Equivalent to specifying both --locked and --offline.
359+
359360
Common Options
360361
+toolchain
361362
If Cargo has been installed with rustup, and the first argument to

src/doc/man/generated_txt/cargo-generate-lockfile.txt

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -46,16 +46,14 @@ OPTIONS
4646
Path to the Cargo.toml file. By default, Cargo searches for the
4747
Cargo.toml file in the current directory or any parent directory.
4848

49-
--frozen, --locked
50-
Either of these flags requires that the Cargo.lock file be
51-
up-to-date. If the lock file is missing, or it needs to be updated,
52-
Cargo will exit with an error. The --frozen flag also prevents Cargo
53-
from attempting to access the network to determine if it is
54-
out-of-date.
49+
--locked
50+
Requires the Cargo.lock file be up-to-date. If the lock file is
51+
missing, or it needs to be updated due to changes in the Cargo.toml
52+
file, for example a new dependency is added, Cargo will exit with an
53+
error.
5554

56-
These may be used in environments where you want to assert that the
57-
Cargo.lock file is up-to-date (such as a CI build) or want to avoid
58-
network access.
55+
It may be used in environments where you want to assert that the
56+
Cargo.lock file is up-to-date (such as a CI build).
5957

6058
--offline
6159
Prevents Cargo from accessing the network for any reason. Without
@@ -72,6 +70,9 @@ OPTIONS
7270
May also be specified with the net.offline config value
7371
<https://doc.rust-lang.org/cargo/reference/config.html>.
7472

73+
--frozen
74+
Equivalent to specifying both --locked and --offline.
75+
7576
Common Options
7677
+toolchain
7778
If Cargo has been installed with rustup, and the first argument to

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

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -242,16 +242,14 @@ OPTIONS
242242
machine-readable JSON information about timing information.
243243

244244
Manifest Options
245-
--frozen, --locked
246-
Either of these flags requires that the Cargo.lock file be
247-
up-to-date. If the lock file is missing, or it needs to be updated,
248-
Cargo will exit with an error. The --frozen flag also prevents Cargo
249-
from attempting to access the network to determine if it is
250-
out-of-date.
245+
--locked
246+
Requires the Cargo.lock file be up-to-date. If the lock file is
247+
missing, or it needs to be updated due to changes in the Cargo.toml
248+
file, for example a new dependency is added, Cargo will exit with an
249+
error.
251250

252-
These may be used in environments where you want to assert that the
253-
Cargo.lock file is up-to-date (such as a CI build) or want to avoid
254-
network access.
251+
It may be used in environments where you want to assert that the
252+
Cargo.lock file is up-to-date (such as a CI build).
255253

256254
--offline
257255
Prevents Cargo from accessing the network for any reason. Without
@@ -268,6 +266,9 @@ OPTIONS
268266
May also be specified with the net.offline config value
269267
<https://doc.rust-lang.org/cargo/reference/config.html>.
270268

269+
--frozen
270+
Equivalent to specifying both --locked and --offline.
271+
271272
Miscellaneous Options
272273
-j N, --jobs N
273274
Number of parallel jobs to run. May also be specified with the

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

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -404,16 +404,14 @@ OPTIONS
404404
Path to the Cargo.toml file. By default, Cargo searches for the
405405
Cargo.toml file in the current directory or any parent directory.
406406

407-
--frozen, --locked
408-
Either of these flags requires that the Cargo.lock file be
409-
up-to-date. If the lock file is missing, or it needs to be updated,
410-
Cargo will exit with an error. The --frozen flag also prevents Cargo
411-
from attempting to access the network to determine if it is
412-
out-of-date.
407+
--locked
408+
Requires the Cargo.lock file be up-to-date. If the lock file is
409+
missing, or it needs to be updated due to changes in the Cargo.toml
410+
file, for example a new dependency is added, Cargo will exit with an
411+
error.
413412

414-
These may be used in environments where you want to assert that the
415-
Cargo.lock file is up-to-date (such as a CI build) or want to avoid
416-
network access.
413+
It may be used in environments where you want to assert that the
414+
Cargo.lock file is up-to-date (such as a CI build).
417415

418416
--offline
419417
Prevents Cargo from accessing the network for any reason. Without
@@ -430,6 +428,9 @@ OPTIONS
430428
May also be specified with the net.offline config value
431429
<https://doc.rust-lang.org/cargo/reference/config.html>.
432430

431+
--frozen
432+
Equivalent to specifying both --locked and --offline.
433+
433434
Common Options
434435
+toolchain
435436
If Cargo has been installed with rustup, and the first argument to

0 commit comments

Comments
 (0)