Open zeichenreihe opened 2 months ago
This would be useful to have, since it would allow easily viewing the dependency tree with only workspace members.
Could you go into more detail on the use case for this? In what scenarios are you wanting to view a tree of only workspace members?
Scenarios:
I think the latter justifies it even more.
Yes it's currently possible to even get the same result, but this requires listing all the dependencies of all crates with --prune
, which is annoying and doesn't scale well.
The cargo team discussed this issue and felt mildly in favor of supporting such an option. We would like to avoid proliferating too many flags in general. One option we discussed was reusing another flag of --depth workspace
to show only to the depth of the workspace members. We felt it would be helpful for being able to see the connections within a large workspace without seeing all the external dependencies.
Problem
I'm opening this issue because https://github.com/rust-lang/cargo/issues/8105#issuecomment-1284860085 said to open one if one wanted that feature.
cargo tree
allows with--prune
to remove dependencies from the list. However, as mentioned in https://github.com/rust-lang/cargo/issues/8105#issuecomment-846336129 it only takes inSPEC
, and not the proposed "non-members" or "members".This would be useful to have, since it would allow easily viewing the dependency tree with only workspace members.
Proposed Solution
The solution would be adding some argument, that would then take the values
both
,member
, andnon-member
(as mentioned in https://github.com/rust-lang/cargo/issues/8105#issuecomment-846336129).I have no proposed name yet for the argument.
Notes
At the time of writing, there does not exist any such command, see https://github.com/rust-lang/cargo/blob/ba8b39413c74d08494f94a7542fe79aa636e1661/src/doc/src/commands/cargo-tree.md for the
cargo tree
documentation at the time of writing.