cargo-tree icon indicating copy to clipboard operation
cargo-tree copied to clipboard

Please support running standalone

Open joshtriplett opened this issue 8 years ago • 4 comments

cargo-tree expects to find a local Cargo.toml file. Please consider adding support for running on a named package directly from the registry: cargo tree somecrate.

joshtriplett avatar Dec 25 '16 18:12 joshtriplett

This seems reasonable.

@alexcrichton any pointers on where to look in the cargo APIs? I need "download this pkgspec and well me where its directory is".

sfackler avatar Dec 25 '16 21:12 sfackler

@sfackler you'd do something like this:

That'll give you one layer and you could apply that recursively.

If, instead, you'd like to work with a Resolve (like you're probably doing today), it'd be a little different:

  • Create a synthetic Summary with a dummy package id, one dependency (the one you're interested in), and no features.
  • Call resolve with this summary, no replacements, and a blank registry, probably a PackageRegistry

Does that make sense?

alexcrichton avatar Dec 25 '16 21:12 alexcrichton

Yep, thanks!

sfackler avatar Dec 25 '16 21:12 sfackler

Hello, any update for this?

equal-l2 avatar Aug 30 '17 08:08 equal-l2