Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Support '-F' as an alias for '--features' #10576

Merged
merged 2 commits into from
Apr 19, 2022
Merged

Conversation

epage
Copy link
Contributor

@epage epage commented Apr 18, 2022

What does this PR try to resolve?

Adds a short flag -F for --features to all cargo commands to be consistent with the -F` short flag being added in #10472.

How should we test and review this PR?

The decision for this is a part of #10472 which is in FCP.

  • It looks like all commands except cargo-add are using the prelude to
    define --features, so this should hit them all.
  • Man pages were updated
  • I've updated completions to the best of my knowledge and am unsure of good testing strategies for them
  • I'm assuming we don't add tests for every sort flag but rely on clap
    to have coverage to ensure it works.

Review the commits separately. For the documentation change, the only manual change is in src/doc/man/includes/section-features.md, the rest are code-generated.

This decision was part of rust-lang#10472

-  It looks like all commands except `cargo-add` are using the prelude to
  define `--features`, so this should hit them all.
- I've updated completions to the best of my knowledge.
- It appears we don't need to update man pages or other documentation.
- I'm assuming we don't add tests for every sort flag but rely on clap
  to have coverage to ensure it works.
@rust-highfive
Copy link

r? @ehuss

(rust-highfive has picked a reviewer for you, use r? to override)

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Apr 18, 2022
@weihanglo
Copy link
Member

Hmm… I still love to see them mentioned in manpages for users to discover this new alias when running cargo help build or else.

https://github.com/rust-lang/cargo/blob/d087aeb845d6fe2b740b27179318d2d5045c2ae9/src/doc/man/includes/section-features.md

The manual change is to `src/doc/man/includes/section-features.md`, the
rest is code-generated.
@epage
Copy link
Contributor Author

epage commented Apr 19, 2022

Hmm… I still love to see them mentioned in manpages for users to discover this new alias when running cargo help build or else.

https://github.com/rust-lang/cargo/blob/d087aeb845d6fe2b740b27179318d2d5045c2ae9/src/doc/man/includes/section-features.md

Done

Copy link
Member

@weihanglo weihanglo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great. Thanks!

@weihanglo
Copy link
Member

@bors r+

@bors
Copy link
Collaborator

bors commented Apr 19, 2022

📌 Commit f728045 has been approved by weihanglo

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Apr 19, 2022
@bors
Copy link
Collaborator

bors commented Apr 19, 2022

⌛ Testing commit f728045 with merge 46c7a2b...

@bors
Copy link
Collaborator

bors commented Apr 19, 2022

☀️ Test successful - checks-actions
Approved by: weihanglo
Pushing 46c7a2b to master...

@bors bors merged commit 46c7a2b into rust-lang:master Apr 19, 2022
@epage epage deleted the feature branch April 19, 2022 02:03
bors added a commit to rust-lang-ci/rust that referenced this pull request Apr 20, 2022
Update cargo

7 commits in dba5baf4345858c591517b24801902a062c399f8..edffc4ada3d77799e5a04eeafd9b2f843d29fc23
2022-04-13 21:58:27 +0000 to 2022-04-19 17:38:29 +0000
- Document cargo-add (rust-lang/cargo#10578)
- feat: Support '-F' as an alias for '--features' (rust-lang/cargo#10576)
- Completion support for `cargo-add` (rust-lang/cargo#10577)
- Add a link to the document in the timings report (rust-lang/cargo#10492)
- feat: Import cargo-add into cargo (rust-lang/cargo#10472)
- Part 8 of RFC2906 - Keep `InheritableFields` in a `LazyCell` inside `… (rust-lang/cargo#10568)
- Part 7 of RFC2906 - Add support for inheriting `exclude` and `include` (rust-lang/cargo#10565)
@ehuss ehuss added this to the 1.62.0 milestone Apr 22, 2022
bors bot added a commit to taiki-e/cargo-llvm-cov that referenced this pull request May 11, 2022
165: Support short flags of --release and --features r=taiki-e a=taiki-e

- `--release` (`-r`) rust-lang/cargo#10133
- `--features` (`-F`) rust-lang/cargo#10576


Co-authored-by: Taiki Endo <te316e89@gmail.com>
bors bot added a commit to taiki-e/cargo-hack that referenced this pull request May 12, 2022
150: Support short flag of --features r=taiki-e a=taiki-e

refs: rust-lang/cargo#10576

Co-authored-by: Taiki Endo <te316e89@gmail.com>
sunshowers pushed a commit to nextest-rs/nextest that referenced this pull request Jun 20, 2022
messense added a commit to messense/maturin that referenced this pull request Jun 28, 2022
Cargo also does this in nightly channel: rust-lang/cargo#10576
bors added a commit that referenced this pull request Feb 26, 2023
Addition of support for -F as an alias for --features

Updated documentation for #10576
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants