about summary refs log tree commit diff
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2024-03-01 12:13:24 +0000
committerbors <bors@rust-lang.org>2024-03-01 12:13:24 +0000
commit346b094a11b653954164be019d3c04ae15b7d2b3 (patch)
treef39c4d9547253c255500baf3f9d652d0406d154c
parente865dca4d76a204e002c223cba1dc804ee9b7c56 (diff)
parentc5f819854c7886d4d32798e72bbad35ec2acda4f (diff)
downloadrust-346b094a11b653954164be019d3c04ae15b7d2b3.tar.gz
rust-346b094a11b653954164be019d3c04ae15b7d2b3.zip
Auto merge of #12218 - jhpratt:manifest-options-doc, r=blyxyas
Document manifest options

All built-in cargo commands have this output included when run with `cargo foo --help`. Clippy is the only exception, so I have copied the text here. As far as I can tell, the flags come from Cargo itself and not clippy, but the user almost certainly does not care about that.

```text
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
```

changelog: Add the standard Manifest Options section to the `--help` output
-rw-r--r--src/main.rs9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/main.rs b/src/main.rs
index dffa854177b..30beaae34d2 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -174,8 +174,13 @@ To allow or deny a lint from the command line you can use <cyan,bold>cargo clipp
 You can use tool lints to allow or deny lints from your code, e.g.:
 
     <yellow,bold>#[allow(clippy::needless_lifetimes)]</>
-"
-    )
+
+<green,bold>Manifest Options:</>
+    <cyan,bold>--manifest-path</> <cyan><<PATH>></>  Path to Cargo.toml
+    <cyan,bold>--frozen</>                Require Cargo.lock and cache are up to date
+    <cyan,bold>--locked</>                Require Cargo.lock is up to date
+    <cyan,bold>--offline</>               Run without accessing the network
+")
 }
 #[cfg(test)]
 mod tests {