Skip to content

feat(cli): add color output for cargo --list #12992

New issue

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

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

Already on GitHub? # to your account

Merged
merged 1 commit into from
Nov 17, 2023

Conversation

weihanglo
Copy link
Member

@weihanglo weihanglo commented Nov 16, 2023

What does this PR try to resolve?

This is a work based on #12578.

Add color output for cargo --list

image

with --verbose:

image

How should we test and review this PR?

This shouldn't impact existent programmatic parsing of the output of cargo --list. For example,

cargo --list 2>/dev/null | awk 'NR>1 {print $1}'

Each case should be covered

  • cargo-fmt and cargo-clippy
  • built-in commands
  • external commands
  • aliases

Additional information

@rustbot
Copy link
Collaborator

rustbot commented Nov 16, 2023

r? @ehuss

(rustbot has picked a reviewer for you, use r? to override)

@rustbot rustbot added A-cli Area: Command-line interface, option parsing, etc. S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Nov 16, 2023
@ehuss
Copy link
Contributor

ehuss commented Nov 16, 2023

Sounds good to add some color, but I'm going to pass the review since I have not quite caught up with the ansi work.

r? epage

@rustbot rustbot assigned epage and unassigned ehuss Nov 16, 2023
@epage
Copy link
Contributor

epage commented Nov 17, 2023

@bors r+

Thanks!

@bors
Copy link
Contributor

bors commented Nov 17, 2023

📌 Commit 2890607 has been approved by epage

It is now in the queue for this repository.

@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 Nov 17, 2023
@epage
Copy link
Contributor

epage commented Nov 17, 2023

@bors r-

@bors bors added S-waiting-on-author Status: The marked PR is awaiting some action (such as code changes) from the PR author. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Nov 17, 2023
@bors
Copy link
Contributor

bors commented Nov 17, 2023

⌛ Testing commit 2890607 with merge 4910db3...

bors added a commit that referenced this pull request Nov 17, 2023
feat(cli): add color output for `cargo --list`
@epage
Copy link
Contributor

epage commented Nov 17, 2023

Sorry, forgot to double check that we were writing to an anstream stream

@bors r+

@bors
Copy link
Contributor

bors commented Nov 17, 2023

📌 Commit 2890607 has been approved by epage

It is now in the queue for this repository.

@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-author Status: The marked PR is awaiting some action (such as code changes) from the PR author. labels Nov 17, 2023
@bors
Copy link
Contributor

bors commented Nov 17, 2023

⌛ Testing commit 2890607 with merge 43fbbc9...

@bors
Copy link
Contributor

bors commented Nov 17, 2023

☀️ Test successful - checks-actions
Approved by: epage
Pushing 43fbbc9 to master...

@bors bors merged commit 43fbbc9 into rust-lang:master Nov 17, 2023
bors added a commit to rust-lang-ci/rust that referenced this pull request Nov 18, 2023
Update cargo

11 commits in 2c03e0e2dcd05dd064fcf10cc1050d342eaf67e3..9765a449d9b7341c2b49b88da41c2268ea599720
2023-11-16 04:21:44 +0000 to 2023-11-17 20:58:23 +0000
- refactor(toml): Clean up workspace inheritance (rust-lang/cargo#12971)
- docs: Recommend a wider selection of libsecret-compatible password managers (rust-lang/cargo#12993)
- feat(cli): add color output for `cargo --list` (rust-lang/cargo#12992)
- refactor: log when loading config from file (rust-lang/cargo#12991)
- Link to rustc lint levels (rust-lang/cargo#12990)
- chore(ci): Catch naive use of AtomicU64 early (rust-lang/cargo#12988)
- cargo-credential-1password: Add missing `--account` argument to `op signin` command (rust-lang/cargo#12985)
- chore: dogfood Cargo `-Zlints` table feature (rust-lang/cargo#12178)
- cargo-credential-1password: Fix README (rust-lang/cargo#12986)
- Fix a rustflags test using a wrong buildfile name (rust-lang/cargo#12987)
- Fix some test output validation. (rust-lang/cargo#12982)

r? ghost
@weihanglo weihanglo deleted the cargo-list branch November 28, 2023 20:13
@ehuss ehuss added this to the 1.76.0 milestone Dec 6, 2023
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
A-cli Area: Command-line interface, option parsing, etc. 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