sfackler / cargo-tree

Apache License 2.0
529 stars 39 forks source link

Add depth option #79

Open mwilliammyers opened 5 years ago

mwilliammyers commented 5 years ago

Adds the -D <DEPTH>/--depth <DEPTH> option.

Closes #60

Example:

❯ cargo tree -D 1

cargo-tree v0.27.0 (~/Developer/cargo-tree)
├── cargo v0.39.0
├── env_logger v0.7.0
├── failure v0.1.5
├── petgraph v0.4.13
└── structopt v0.3.2

Things to consider:

Boscop commented 5 years ago

Thanks, I'm looking forward to this! :)

therealbnut commented 4 years ago

Thanks for working on this @mwilliammyers! What does it do if you set the --depth=1, and your dependency tree looks like this?

 A
 |- B
    |- C

However, A, B, and C are all in your workspace.

I think the ideal solution to #60 would let you show only dependencies referenced directly in your Cargo.toml files (ie. the things you've specified, local or remote).

mwilliammyers commented 4 years ago

Assuming A is your "main" (or lib) crate then it would do:

 A
 |- B
mwilliammyers commented 4 years ago

@sfackler if I fix the conflicts with master, is this a feature that you would consider adding?