g-k / cargo-show Goto Github PK
View Code? Open in Web Editor NEWcargo subcommand to print package metadata like pip show, apt-cache show, npm view, gem query, etc.
cargo subcommand to print package metadata like pip show, apt-cache show, npm view, gem query, etc.
It's been for a while:
$ cargo show bat --json
Error fetching data for bat: api errors (status 404 Not Found): Not Found
The culprit:
curl -ik https://crates.io//api/v1/crates/bat
vs
curl -ik https://crates.io/api/v1/crates/bat
.
Apparently, it is a bug in crates.io, but it's better to fix it here.
Read https://doc.rust-lang.org/book/error-handling.html again and flatten nesting.
The cargo version used depends on libgit2-sys v0.4.6, which no longer builds on Debian Testing. Since newer versions build just fine, the easiest fix would be to update to newer cargo.
The errors are:
libgit2-sys-0.4.6/libgit2/src/openssl_stream.c:146:3: error: dereferencing pointer to incomplete type ‘BIO {aka struct bio_st}’
libgit2-sys-0.4.6/libgit2/src/openssl_stream.c:204:1: error: variable ‘git_stream_bio_method’ has initializer but incomplete type
Now that multiple registries seems stable it would be good to allow that. Just take registry description with -Zunstable and use that URL ...
I just installed cargo-show
v0.5.9, and no matter what crate I view with it, the license is always displayed as None
. For example, despite clap's crates.io page saying it's licensed under MIT or Apache-2.0, cargo show clap
gives:
---
id: clap
name: clap
description: A simple to use, efficient, and full-featured Command Line Argument Parser
documentation: None
homepage: None
repository: https://github.com/clap-rs/clap
max_version: 3.2.8
downloads: 63587041
license: None
created: 2015-03-01T01:17:24.903018+00:00
updated: 2022-06-30T13:26:01.537514+00:00
It has been deprecated: announcement.
Looks like this is blocked by docopt/docopt.rs#128. I will follow up in this issue when they have a new release ready.
@pravic thanks for helping out recently, are you interested in getting write access to the repo and being credited as a maintainer?
If so, I'll make the changes:
and expect the usual open source stuff from you (basically what you've been doing already):
Related to caching.
Sometimes I need to view dependencies of some crate and I think that it would be easier to add this feature (via a command line option) here rather than creating a separate tool for that.
What do you think?
A crate's feature flags are currently only showed in the JSON output, and not the default user friendly view. I think it would be a great addition to figure out the features of dependencies without looking them up on crates.io/lib.rs first.
Somebody is parking the webrender pkg name so it doesn't test 404 results:
cargo show webrender master
---
id: webrender
name: webrender
description: Placeholder for WebRender
documentation: None
homepage: None
repository: None
max_version: 0.0.0
downloads: 19
license: None
created: 2018-08-14T23:10:55.298067+00:00
updated: 2018-08-14T23:10:55.298067+00:00
cargo-show has stopped working for me, IIRC this has been an issue for me for a few months now. I always get the following:
% cargo show --version
cargo-show version 0.5.5
% cargo show cargo-show
Error fetching data for cargo-show: received 403 unauthorized response code
This seems to happen for all crates queried. I've in the meantime started to use the chit
crate instead, as a workaround.
like git log --format
warning: package `quote v1.0.2` in Cargo.lock is yanked in registry `crates.io`, consider updating to a version that is not yanked
To continue from #15.
If you'd rather have quieter output, I'd be OK with just printing just the id or name or both with the dependents instead of the full metadata.
I'd rather go with an additional option (like, -q
or --brief
) that eliminates id
, homepage
, downloads
(?),
Compare:
$ cargo show tokio
--
id: tokio
name: tokio
description: An event-driven, non-blocking I/O platform for writing asynchronous I/O
backed applications.
documentation: https://docs.rs/tokio/0.1
homepage: https://tokio.rs
repository: https://github.com/tokio-rs/tokio
max_version: 0.1.7
downloads: 315648
license: None
created: 2016-07-01T20:39:07.497766+00:00
updated: 2018-06-07T03:20:24.962151+00:00
vs
$ cargo show tokio --brief
--
name: tokio
description: An event-driven, non-blocking I/O platform for writing asynchronous I/O
backed applications.
documentation: https://docs.rs/tokio/0.1
repository: https://github.com/tokio-rs/tokio
max_version: 0.1.7
updated: 2018-06-07T03:20:24.962151+00:00
Also I'd replace downloads
' number with a human-readable format (at least, 315,648, or 315K).
see: #15 (comment)
to match development and actually get this thing published.
see: #15 (comment)
Reuse the _
query param the website uses.
Figure out where to put the files.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.