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

When -v is passed with --list, display path to custom commands #5041

Merged

Conversation

pwoolcoc
Copy link
Contributor

@pwoolcoc pwoolcoc commented Feb 14, 2018

With this change, output of cargo --list changes slightly when 1 or more -v flags are passed:

 ± ./target/debug/cargo --list -v
Installed Commands:
    add                  /path/to/home/.cargo/bin/cargo-add
    bench
    build
    canoe                /path/to/home/.cargo/bin/cargo-canoe
    check
    clean
    do                   /path/to/home/.cargo/bin/cargo-do
    doc
    fetch
    fmt                  /path/to/home/.cargo/bin/cargo-fmt
    ...

@rust-highfive
Copy link

r? @matklad

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

@matklad
Copy link
Member

matklad commented Feb 14, 2018

Seems like a nifty idea to me!

@rust-lang/cargo thoughts about this new feature?

@alexcrichton
Copy link
Member

Sounds neat to me!

@lukaslueg
Copy link
Contributor

Maybe it makes sense to have a verbatim output of just the path-values, so the output may be easily consumed by another program via the shell? All that is required is for Installed commands: to be put to stderr instead of stdout; a single awk could extract the paths. If the output is just the paths (if they exist at all), it would be even easier.

@matklad
Copy link
Member

matklad commented Feb 19, 2018

@bors r+

Thanks @pwoolcoc

@lukaslueg do you have a particular use-case for this in mind though? I'd rather not make promises about particular output format until we have a solid understanding of the use-case.

@bors
Copy link
Collaborator

bors commented Feb 19, 2018

📌 Commit f76db9c has been approved by matklad

@matklad matklad added the relnotes Release-note worthy label Feb 19, 2018
bors added a commit that referenced this pull request Feb 19, 2018
…erbose, r=matklad

When -v is passed with --list, display path to custom commands

With this change, output of `cargo --list` changes slightly when 1 or more `-v` flags are passed:

```
 ± ./target/debug/cargo --list -v
Installed Commands:
    add                  /path/to/home/.cargo/bin/cargo-add
    bench
    build
    canoe                /path/to/home/.cargo/bin/cargo-canoe
    check
    clean
    do                   /path/to/home/.cargo/bin/cargo-do
    doc
    fetch
    fmt                  /path/to/home/.cargo/bin/cargo-fmt
    ...
```
@bors
Copy link
Collaborator

bors commented Feb 19, 2018

⌛ Testing commit f76db9c with merge 00eb24d...

@bors
Copy link
Collaborator

bors commented Feb 19, 2018

☀️ Test successful - status-appveyor, status-travis
Approved by: matklad
Pushing 00eb24d to master...

@bors bors merged commit f76db9c into rust-lang:master Feb 19, 2018
@ehuss ehuss added this to the 1.26.0 milestone Feb 6, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
relnotes Release-note worthy
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants