Skip to content

Commit

Permalink
doc: Hide offline flag for cargo-fetch
Browse files Browse the repository at this point in the history
  • Loading branch information
linyihai committed Jan 29, 2024
1 parent 95e113c commit b745dbb
Show file tree
Hide file tree
Showing 7 changed files with 4 additions and 44 deletions.
1 change: 1 addition & 0 deletions src/bin/cargo/commands/fetch.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ pub fn cli() -> Command {
.arg_silent_suggestion()
.arg_target_triple("Fetch dependencies for the target triple")
.arg_manifest_path()
.arg(flag("offline", "Run without accessing the network").hide(true))
.after_help(color_print::cstr!(
"Run `<cyan,bold>cargo help fetch</>` for more detailed information.\n"
))
Expand Down
1 change: 1 addition & 0 deletions src/doc/man/cargo-fetch.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
{{~*set command="fetch"}}
{{~*set actionverb="Fetch"}}
{{~*set target-default-to-all-arch=true}}
{{~*set no-offline-option=true}}
{{~*set multitarget=true}}

## NAME
Expand Down
15 changes: 0 additions & 15 deletions src/doc/man/generated_txt/cargo-fetch.txt
Original file line number Diff line number Diff line change
Expand Up @@ -82,21 +82,6 @@ OPTIONS
Cargo.lock file is up-to-date (such as a CI build) or want to avoid
network access.

--offline
Prevents Cargo from accessing the network for any reason. Without
this flag, Cargo will stop with an error if it needs to access the
network and the network is not available. With this flag, Cargo will
attempt to proceed without the network if possible.

Beware that this may result in different dependency resolution than
online mode. Cargo will restrict itself to crates that are
downloaded locally, even if there might be a newer version as
indicated in the local copy of the index. See the cargo-fetch(1)
command to download dependencies before going offline.

May also be specified with the net.offline config value
<https://doc.rust-lang.org/cargo/reference/config.html>.

Common Options
+toolchain
If Cargo has been installed with rustup, and the first argument to
Expand Down
2 changes: 2 additions & 0 deletions src/doc/man/includes/options-locked.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ These may be used in environments where you want to assert that the
access.
{{/option}}

{{#if (ne no-offline-option true)}}
{{#option "`--offline`"}}
Prevents Cargo from accessing the network for any reason. Without this
flag, Cargo will stop with an error if it needs to access the network and
Expand All @@ -23,3 +24,4 @@ offline.

May also be specified with the `net.offline` [config value](../reference/config.html).
{{/option}}
{{/if}}
12 changes: 0 additions & 12 deletions src/doc/src/commands/cargo-fetch.md
Original file line number Diff line number Diff line change
Expand Up @@ -90,18 +90,6 @@ attempting to access the network to determine if it is out-of-date.</p>
access.</dd>


<dt class="option-term" id="option-cargo-fetch---offline"><a class="option-anchor" href="#option-cargo-fetch---offline"></a><code>--offline</code></dt>
<dd class="option-desc">Prevents Cargo from accessing the network for any reason. Without this
flag, Cargo will stop with an error if it needs to access the network and
the network is not available. With this flag, Cargo will attempt to
proceed without the network if possible.</p>
<p>Beware that this may result in different dependency resolution than online
mode. Cargo will restrict itself to crates that are downloaded locally, even
if there might be a newer version as indicated in the local copy of the index.
See the <a href="cargo-fetch.html">cargo-fetch(1)</a> command to download dependencies before going
offline.</p>
<p>May also be specified with the <code>net.offline</code> <a href="../reference/config.html">config value</a>.</dd>

</dl>

### Common Options
Expand Down
16 changes: 0 additions & 16 deletions src/etc/man/cargo-fetch.1
Original file line number Diff line number Diff line change
Expand Up @@ -95,22 +95,6 @@ These may be used in environments where you want to assert that the
\fBCargo.lock\fR file is up\-to\-date (such as a CI build) or want to avoid network
access.
.RE
.sp
\fB\-\-offline\fR
.RS 4
Prevents Cargo from accessing the network for any reason. Without this
flag, Cargo will stop with an error if it needs to access the network and
the network is not available. With this flag, Cargo will attempt to
proceed without the network if possible.
.sp
Beware that this may result in different dependency resolution than online
mode. Cargo will restrict itself to crates that are downloaded locally, even
if there might be a newer version as indicated in the local copy of the index.
See the \fBcargo\-fetch\fR(1) command to download dependencies before going
offline.
.sp
May also be specified with the \fBnet.offline\fR \fIconfig value\fR <https://doc.rust\-lang.org/cargo/reference/config.html>\&.
.RE
.SS "Common Options"
.sp
\fB+\fR\fItoolchain\fR
Expand Down
1 change: 0 additions & 1 deletion tests/testsuite/cargo_fetch/help/stdout.log
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,5 @@ Manifest Options:
--manifest-path <PATH> Path to Cargo.toml
--frozen Require Cargo.lock and cache are up to date
--locked Require Cargo.lock is up to date
--offline Run without accessing the network

Run `cargo help fetch` for more detailed information.

0 comments on commit b745dbb

Please sign in to comment.