From c028c7241074e15aaed859c69065a6de7d7f2fb4 Mon Sep 17 00:00:00 2001 From: Lin Yihai Date: Mon, 29 Jan 2024 11:46:11 +0800 Subject: [PATCH] doc: Hide `cargo-fetch` description in offline man page --- src/doc/man/generated_txt/cargo-fetch.txt | 3 +-- src/doc/man/includes/options-locked.md | 4 +++- src/doc/src/commands/cargo-fetch.md | 4 +--- src/etc/man/cargo-fetch.1 | 2 -- 4 files changed, 5 insertions(+), 8 deletions(-) diff --git a/src/doc/man/generated_txt/cargo-fetch.txt b/src/doc/man/generated_txt/cargo-fetch.txt index cbd3169c313..1c30a3540f4 100644 --- a/src/doc/man/generated_txt/cargo-fetch.txt +++ b/src/doc/man/generated_txt/cargo-fetch.txt @@ -91,8 +91,7 @@ OPTIONS 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. + indicated in the local copy of the index. May also be specified with the net.offline config value . diff --git a/src/doc/man/includes/options-locked.md b/src/doc/man/includes/options-locked.md index c9ac9524e3c..6fd1c9a6701 100644 --- a/src/doc/man/includes/options-locked.md +++ b/src/doc/man/includes/options-locked.md @@ -18,8 +18,10 @@ 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. +{{#if (ne command "fetch")}} See the {{man "cargo-fetch" 1}} command to download dependencies before going offline. +{{/if}} May also be specified with the `net.offline` [config value](../reference/config.html). -{{/option}} +{{/option}} \ No newline at end of file diff --git a/src/doc/src/commands/cargo-fetch.md b/src/doc/src/commands/cargo-fetch.md index aa0be675c2c..19a00136846 100644 --- a/src/doc/src/commands/cargo-fetch.md +++ b/src/doc/src/commands/cargo-fetch.md @@ -97,9 +97,7 @@ 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.

+if there might be a newer version as indicated in the local copy of the index.

May also be specified with the net.offline config value. diff --git a/src/etc/man/cargo-fetch.1 b/src/etc/man/cargo-fetch.1 index 3779b9c2862..428dc882a81 100644 --- a/src/etc/man/cargo-fetch.1 +++ b/src/etc/man/cargo-fetch.1 @@ -106,8 +106,6 @@ 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 \fBcargo\-fetch\fR(1) command to download dependencies before going -offline. .sp May also be specified with the \fBnet.offline\fR \fIconfig value\fR \&. .RE