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

cargo info doesn't allow to specify output-format #14469

Open
GopherJ opened this issue Aug 30, 2024 · 5 comments
Open

cargo info doesn't allow to specify output-format #14469

GopherJ opened this issue Aug 30, 2024 · 5 comments
Labels
C-feature-request Category: proposal for a feature. Before PR, ping rust-lang/cargo if this is not `Feature accepted` Command-info S-needs-info Status: Needs more info, such as a reproduction or more background for a feature request.

Comments

@GopherJ
Copy link

GopherJ commented Aug 30, 2024

Problem

it'll be good to support output-format

Proposed Solution

No response

Notes

No response

@GopherJ GopherJ added C-feature-request Category: proposal for a feature. Before PR, ping rust-lang/cargo if this is not `Feature accepted` S-triage Status: This issue is waiting on initial triage. labels Aug 30, 2024
@epage epage added S-needs-info Status: Needs more info, such as a reproduction or more background for a feature request. Command-info labels Aug 30, 2024
@epage
Copy link
Contributor

epage commented Aug 30, 2024

What other output format would you want and what is the use care for it?

@GopherJ
Copy link
Author

GopherJ commented Aug 31, 2024

@epage output format allow us to integrate other tools. I always want to be productive so I have the following alias:

# instead of seaching the crate and click to go to the repository, I use cbrowse
function cbrowse
  if test -n "$argv[1]"
    open -u (cargo info $argv[1] | grep repository | awk '{print $2}')
  end
end
# instead of seaching the crate and find it's repository url, I use cclone
function cclone
  if test -n "$argv[1]"
    git clone (cargo info $argv[1] | grep repository | awk '{print $2}')
  end
end

in the future I may come up with other scripts for handling things like features, if it's displayed as json then things may be easier

@epage
Copy link
Contributor

epage commented Aug 31, 2024

Is there reason you want to use this over cargo metatdata? That is generally our answer for programmatic use. This is a UX focused command that we can change the output on as needed.

@GopherJ
Copy link
Author

GopherJ commented Sep 1, 2024

@epage cargo metadata is for local crates, cargo info is for crates on crates.io, in my case it's for for things on crates.io because it contains many more than local ones

@epage
Copy link
Contributor

epage commented Sep 3, 2024

Would your needs be covered by #11034?

@weihanglo weihanglo removed the S-triage Status: This issue is waiting on initial triage. label Sep 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-feature-request Category: proposal for a feature. Before PR, ping rust-lang/cargo if this is not `Feature accepted` Command-info S-needs-info Status: Needs more info, such as a reproduction or more background for a feature request.
Projects
None yet
Development

No branches or pull requests

3 participants