-
Notifications
You must be signed in to change notification settings - Fork 2.6k
cargo-tree: Add more pruning options. #8105
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Comments
Maybe this feature is supposed to be in |
Another question about [features]
default = ["std"]
std = [] $ cargo tree -e features
cargo v0.55.0 (/home/rust/cargo)
├── anyhow feature "default"
│ ├── anyhow v1.0.38
│ └── anyhow feature "std"
│ └── anyhow v1.0.38 How should One way is treating feature nodes as normal dep nodes which are counted in when calculating depths. This approach is feasible but I am afraid it's not that informative and useful. To find the same dependency showing in The other solution I can think of is skipping all feature node, only take dep nodes into account when calculating depths. Although the meaning of I prefer the first to the second. The first is also trivial to implement. |
Yea, using a non-numeric value for As for which behavior to use, the first is probably easier, so I would lean towards that, and then see how it goes. The |
For pruning workspace members/non-members, I propose that adopting the other option which accepts |
Add `--depth` option for `cargo-tree` Part of #8105 Note that the `--depth` option only regards the "tree" depth but not dependency depth. ## To resolve Bike-shedding naming problem: `-L,--level` or `--depth`?
Add `--prune` option for cargo-tree Part of #8105 Prune the given package from the display of the dependency tree. Also providing a nice suggestion if the package is not within the resolved dependency graph.
I think this was resolved. If anyone wants features mentioned in #8105 (comment), please file a new issue instead. |
A large tree can be hard to look at and navigate. It would be useful if cargo-tree had more options for reducing or pruning the packages displayed. Some ideas:
depth
Add a
--depth
option to cargo-tree to control the depth displayed.A numeric value would be simple, but perhaps other string options like "workspace" (limit to workspace members) would be useful.
See sfackler/cargo-tree#60 and #8062 (comment). (Or maybe
--prune=non-member
?)prune
Add a
--prune
option which will remove a specific package (and all its dependencies). For example,--prune rustc-workspace-hack
in the rustc repo.The text was updated successfully, but these errors were encountered: