Skip to content

Commit f75aee0

Browse files
committed
Auto merge of #11033 - buggymcbugfix:buggymcbugfix/cargo-add-docs, r=epage
Very slight `cargo add` documentation improvements As discussed in rust-lang/book#3331, a quick explanation of the `Features` part of the message that gets printed to stdout when adding some dependency. Consider the following example: ``` cargo add my-crate Updating crates.io index Adding my-crate v0.1.0 to dependencies. Features: + foo - bar ``` It was not clear to me what `+foo` and `-bar` meant until `@carols10cents'` kindly explained it to me. Hopefully the documentation now clarifies this. TODO: - [x] Run `./build-man.sh`
2 parents 996a636 + 9c8a8ea commit f75aee0

File tree

4 files changed

+17
-0
lines changed

4 files changed

+17
-0
lines changed

src/doc/man/cargo-add.md

+5
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,11 @@ If no source is specified, then a best effort will be made to select one, includ
3131

3232
When you add a package that is already present, the existing entry will be updated with the flags specified.
3333

34+
Upon successful invocation, the enabled (`+`) and disabled (`-`) [features] of the specified
35+
dependency will be listed in the command's output.
36+
37+
[features]: ../reference/features.md
38+
3439
## OPTIONS
3540

3641
### Source options

src/doc/man/generated_txt/cargo-add.txt

+4
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,10 @@ DESCRIPTION
3232
When you add a package that is already present, the existing entry will
3333
be updated with the flags specified.
3434

35+
Upon successful invocation, the enabled (+) and disabled (-) features
36+
<https://doc.rust-lang.org/cargo/reference/features.md> of the specified
37+
dependency will be listed in the command's output.
38+
3539
OPTIONS
3640
Source options
3741
--git url

src/doc/src/commands/cargo-add.md

+5
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,11 @@ If no source is specified, then a best effort will be made to select one, includ
3131

3232
When you add a package that is already present, the existing entry will be updated with the flags specified.
3333

34+
Upon successful invocation, the enabled (`+`) and disabled (`-`) [features] of the specified
35+
dependency will be listed in the command's output.
36+
37+
[features]: ../reference/features.md
38+
3439
## OPTIONS
3540

3641
### Source options

src/etc/man/cargo-add.1

+3
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,9 @@ If no source is specified, then a best effort will be made to select one, includ
4343
.RE
4444
.sp
4545
When you add a package that is already present, the existing entry will be updated with the flags specified.
46+
.sp
47+
Upon successful invocation, the enabled (\fB+\fR) and disabled (\fB\-\fR) \fIfeatures\fR <https://doc.rust\-lang.org/cargo/reference/features.md> of the specified
48+
dependency will be listed in the command's output.
4649
.SH "OPTIONS"
4750
.SS "Source options"
4851
.sp

0 commit comments

Comments
 (0)