Skip to content

Commit 709f1be

Browse files
committedApr 26, 2022
Document the use of @ in PKGID Specs
Since the `cargo pkgid` docs were so brief, I figured I'd focus on the expected common case and only cover `@` while the reference mentions both in the grammar.
1 parent cdec383 commit 709f1be

File tree

5 files changed

+20
-20
lines changed

5 files changed

+20
-20
lines changed
 

‎src/doc/man/cargo-pkgid.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,11 @@ following:
2727
SPEC Structure | Example SPEC
2828
---------------------------|--------------
2929
_name_ | `bitflags`
30-
_name_`:`_version_ | `bitflags:1.0.4`
30+
_name_`@`_version_ | `bitflags@1.0.4`
3131
_url_ | `https://github.com/rust-lang/cargo`
3232
_url_`#`_version_ | `https://github.com/rust-lang/cargo#0.33.0`
3333
_url_`#`_name_ | `https://github.com/rust-lang/crates.io-index#bitflags`
34-
_url_`#`_name_`:`_version_ | `https://github.com/rust-lang/cargo#crates-io:0.21.0`
34+
_url_`#`_name_`:`_version_ | `https://github.com/rust-lang/cargo#crates-io@0.21.0`
3535

3636
## OPTIONS
3737

@@ -75,7 +75,7 @@ Get the package ID for the given package instead of the current package.
7575

7676
2. Retrieve package specification for version 1.0.0 of `foo`:
7777

78-
cargo pkgid foo:1.0.0
78+
cargo pkgid foo@1.0.0
7979

8080
3. Retrieve package specification for `foo` from crates.io:
8181

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ DESCRIPTION
2626
+-----------------+--------------------------------------------------+
2727
| name | bitflags |
2828
+-----------------+--------------------------------------------------+
29-
| name:version | bitflags:1.0.4 |
29+
| name@version | bitflags@1.0.4 |
3030
+-----------------+--------------------------------------------------+
3131
| url | https://github.com/rust-lang/cargo |
3232
+-----------------+--------------------------------------------------+
@@ -36,7 +36,7 @@ DESCRIPTION
3636
| | https://github.com/rust-lang/crates.io-index#bitflags |
3737
+-----------------+--------------------------------------------------+
3838
| | |
39-
| url#name:version | https://github.com/rust-lang/cargo#crates-io:0.21.0 |
39+
| url#name:version | https://github.com/rust-lang/cargo#crates-io@0.21.0 |
4040
+-----------------+--------------------------------------------------+
4141

4242
OPTIONS
@@ -133,7 +133,7 @@ EXAMPLES
133133

134134
2. Retrieve package specification for version 1.0.0 of foo:
135135

136-
cargo pkgid foo:1.0.0
136+
cargo pkgid foo@1.0.0
137137

138138
3. Retrieve package specification for foo from crates.io:
139139

‎src/doc/src/commands/cargo-pkgid.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,11 @@ following:
2727
SPEC Structure | Example SPEC
2828
---------------------------|--------------
2929
_name_ | `bitflags`
30-
_name_`:`_version_ | `bitflags:1.0.4`
30+
_name_`@`_version_ | `bitflags@1.0.4`
3131
_url_ | `https://github.com/rust-lang/cargo`
3232
_url_`#`_version_ | `https://github.com/rust-lang/cargo#0.33.0`
3333
_url_`#`_name_ | `https://github.com/rust-lang/crates.io-index#bitflags`
34-
_url_`#`_name_`:`_version_ | `https://github.com/rust-lang/cargo#crates-io:0.21.0`
34+
_url_`#`_name_`:`_version_ | `https://github.com/rust-lang/cargo#crates-io@0.21.0`
3535

3636
## OPTIONS
3737

@@ -159,7 +159,7 @@ details on environment variables that Cargo reads.
159159

160160
2. Retrieve package specification for version 1.0.0 of `foo`:
161161

162-
cargo pkgid foo:1.0.0
162+
cargo pkgid foo@1.0.0
163163

164164
3. Retrieve package specification for `foo` from crates.io:
165165

‎src/doc/src/reference/pkgid-spec.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,12 @@ is a string which is used to uniquely refer to one package within a graph of
99
packages.
1010

1111
The specification may be fully qualified, such as
12-
`https://github.com/rust-lang/crates.io-index#regex:1.4.3` or it may be
12+
`https://github.com/rust-lang/crates.io-index#regex@1.4.3` or it may be
1313
abbreviated, such as `regex`. The abbreviated form may be used as long as it
1414
uniquely identifies a single package in the dependency graph. If there is
1515
ambiguity, additional qualifiers can be added to make it unique. For example,
1616
if there are two versions of the `regex` package in the graph, then it can be
17-
qualified with a version to make it unique, such as `regex:1.4.3`.
17+
qualified with a version to make it unique, such as `regex@1.4.3`.
1818

1919
#### Specification grammar
2020

@@ -23,7 +23,7 @@ The formal grammar for a Package Id Specification is:
2323
```notrust
2424
spec := pkgname
2525
| proto "://" hostname-and-path [ "#" ( pkgname | semver ) ]
26-
pkgname := name [ ":" semver ]
26+
pkgname := name [ ("@" | ":" ) semver ]
2727

2828
proto := "http" | "git" | ...
2929
```
@@ -40,17 +40,17 @@ The following are references to the `regex` package on `crates.io`:
4040
| Spec | Name | Version |
4141
|:------------------------------------------------------------|:-------:|:-------:|
4242
| `regex` | `regex` | `*` |
43-
| `regex:1.4.3` | `regex` | `1.4.3` |
43+
| `regex@1.4.3` | `regex` | `1.4.3` |
4444
| `https://github.com/rust-lang/crates.io-index#regex` | `regex` | `*` |
45-
| `https://github.com/rust-lang/crates.io-index#regex:1.4.3` | `regex` | `1.4.3` |
45+
| `https://github.com/rust-lang/crates.io-index#regex@1.4.3` | `regex` | `1.4.3` |
4646

4747
The following are some examples of specs for several different git dependencies:
4848

4949
| Spec | Name | Version |
5050
|:----------------------------------------------------------|:----------------:|:--------:|
5151
| `https://github.com/rust-lang/cargo#0.52.0` | `cargo` | `0.52.0` |
52-
| `https://github.com/rust-lang/cargo#cargo-platform:0.1.2` | <nobr>`cargo-platform`</nobr> | `0.1.2` |
53-
| `ssh://git@github.com/rust-lang/regex.git#regex:1.4.3` | `regex` | `1.4.3` |
52+
| `https://github.com/rust-lang/cargo#cargo-platform@0.1.2` | <nobr>`cargo-platform`</nobr> | `0.1.2` |
53+
| `ssh://git@github.com/rust-lang/regex.git#regex@1.4.3` | `regex` | `1.4.3` |
5454

5555
Local packages on the filesystem can use `file://` URLs to reference them:
5656

‎src/etc/man/cargo-pkgid.1

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,9 @@ T}:T{
3636
\fBbitflags\fR
3737
T}
3838
T{
39-
\fIname\fR\fB:\fR\fIversion\fR
39+
\fIname\fR\fB@\fR\fIversion\fR
4040
T}:T{
41-
\fBbitflags:1.0.4\fR
41+
\fBbitflags@1.0.4\fR
4242
T}
4343
T{
4444
\fIurl\fR
@@ -58,7 +58,7 @@ T}
5858
T{
5959
\fIurl\fR\fB#\fR\fIname\fR\fB:\fR\fIversion\fR
6060
T}:T{
61-
\fBhttps://github.com/rust\-lang/cargo#crates\-io:0.21.0\fR
61+
\fBhttps://github.com/rust\-lang/cargo#crates\-io@0.21.0\fR
6262
T}
6363
.TE
6464
.sp
@@ -195,7 +195,7 @@ cargo pkgid foo
195195
.sp
196196
.RS 4
197197
.nf
198-
cargo pkgid foo:1.0.0
198+
cargo pkgid foo@1.0.0
199199
.fi
200200
.RE
201201
.RE

0 commit comments

Comments
 (0)
Please sign in to comment.