Skip to content
This repository has been archived by the owner on Jun 5, 2020. It is now read-only.

Option to limit tree depth #60

Open
fenhl opened this issue Mar 9, 2019 · 2 comments · May be fixed by #79
Open

Option to limit tree depth #60

fenhl opened this issue Mar 9, 2019 · 2 comments · May be fixed by #79

Comments

@fenhl
Copy link

fenhl commented Mar 9, 2019

For example, --depth=2 to only show my dependencies and their direct dependencies.

@SuperFluffy
Copy link

I wanted to have a quick overview of the direct dependencies of my crate without having to open Cargo.toml. Something akin to what was possible with cargo ls.

An option --depth=1 and maybe aliased to --ls would be super useful.

@Boscop
Copy link

Boscop commented Sep 23, 2019

Yes, please add --depth, and a shortcut -D being equivalent to --depth=1 because this is the most useful.
E.g. to find out which crates in your workspace use different versions of the same dep (assuming you run this in your main crate that depends on all other workspace crates):

cargo tree -d --depth=1 | rg '^\w'

Without --depth=1, it shows duplicates among transitive deps, which you have no control over.

mwilliammyers added a commit to mwilliammyers/cargo-tree that referenced this issue Sep 29, 2019
mwilliammyers added a commit to mwilliammyers/cargo-tree that referenced this issue Sep 29, 2019
@mwilliammyers mwilliammyers linked a pull request Sep 29, 2019 that will close this issue
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants