Skip to content

Commit

Permalink
fix: Remove default registry reference in info cmd docs (#14880)
Browse files Browse the repository at this point in the history
### What does this PR try to resolve?

close #14810

Remove the registry description to reduce confusion, as the `spec`
already explains local `Cargo.toml` inspection behavior.

### How should we test and review this PR?

The unit test has been updated.

### Additional information

r? @epage
  • Loading branch information
weihanglo authored Dec 1, 2024
2 parents 0d730ac + a44ada0 commit 048d0d7
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 17 deletions.
2 changes: 1 addition & 1 deletion src/bin/cargo/commands/info.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ use cargo_util_schemas::core::PackageIdSpec;

pub fn cli() -> Command {
Command::new("info")
.about("Display information about a package in the registry")
.about("Display information about a package")
.arg(
Arg::new("package")
.required(true)
Expand Down
6 changes: 3 additions & 3 deletions src/doc/man/cargo-info.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@

## NAME

cargo-info --- Display information about a package in the registry. Default registry is crates.io
cargo-info --- Display information about a package.

## SYNOPSIS

`cargo info` [_options_] _spec_

## DESCRIPTION

This command displays information about a package in the registry. It fetches data from the package's Cargo.toml file
This command displays information about a package. It fetches data from the package's Cargo.toml file
and presents it in a human-readable format.

## OPTIONS
Expand Down Expand Up @@ -60,7 +60,7 @@ selected based on the Minimum Supported Rust Version (MSRV).
cargo info [email protected]
3. Inspect the `serde` package form the local registry:

cargo info serde --registry my-registry
cargo info serde --registry my-registry

## SEE ALSO

Expand Down
11 changes: 5 additions & 6 deletions src/doc/man/generated_txt/cargo-info.txt
Original file line number Diff line number Diff line change
@@ -1,16 +1,15 @@
CARGO-INFO(1)

NAME
cargo-info — Display information about a package in the registry.
Default registry is crates.io
cargo-info — Display information about a package.

SYNOPSIS
cargo info [options] spec

DESCRIPTION
This command displays information about a package in the registry. It
fetches data from the package’s Cargo.toml file and presents it in a
human-readable format.
This command displays information about a package. It fetches data from
the package’s Cargo.toml file and presents it in a human-readable
format.

OPTIONS
Info Options
Expand Down Expand Up @@ -149,7 +148,7 @@ EXAMPLES

3. Inspect the serde package form the local registry:

cargo info serde --registry my-registry
cargo info serde --registry my-registry

SEE ALSO
cargo(1), cargo-search(1)
Expand Down
6 changes: 3 additions & 3 deletions src/doc/src/commands/cargo-info.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@

## NAME

cargo-info --- Display information about a package in the registry. Default registry is crates.io
cargo-info --- Display information about a package.

## SYNOPSIS

`cargo info` [_options_] _spec_

## DESCRIPTION

This command displays information about a package in the registry. It fetches data from the package's Cargo.toml file
This command displays information about a package. It fetches data from the package's Cargo.toml file
and presents it in a human-readable format.

## OPTIONS
Expand Down Expand Up @@ -161,7 +161,7 @@ details on environment variables that Cargo reads.
cargo info [email protected]
3. Inspect the `serde` package form the local registry:

cargo info serde --registry my-registry
cargo info serde --registry my-registry

## SEE ALSO

Expand Down
6 changes: 3 additions & 3 deletions src/etc/man/cargo-info.1
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@
.ad l
.ss \n[.ss] 0
.SH "NAME"
cargo\-info \[em] Display information about a package in the registry. Default registry is crates.io
cargo\-info \[em] Display information about a package.
.SH "SYNOPSIS"
\fBcargo info\fR [\fIoptions\fR] \fIspec\fR
.SH "DESCRIPTION"
This command displays information about a package in the registry. It fetches data from the package\[cq]s Cargo.toml file
This command displays information about a package. It fetches data from the package\[cq]s Cargo.toml file
and presents it in a human\-readable format.
.SH "OPTIONS"
.SS "Info Options"
Expand Down Expand Up @@ -193,7 +193,7 @@ details on environment variables that Cargo reads.
.sp
.RS 4
.nf
cargo info serde \-\-registry my\-registry
cargo info serde \-\-registry my\-registry
.fi
.RE
.RE
Expand Down
2 changes: 1 addition & 1 deletion tests/testsuite/cargo_info/help/stdout.term.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 048d0d7

Please sign in to comment.