implement --depth, --prune for pip tree (#4440)

This commit is contained in:
Chan Kang 2024-06-26 20:34:31 -04:00 committed by GitHub
parent 2eb1e6693c
commit c74ef75059
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 349 additions and 2 deletions

View file

@ -1404,6 +1404,13 @@ pub struct PipShowArgs {
#[derive(Args)]
#[allow(clippy::struct_excessive_bools)]
pub struct PipTreeArgs {
/// Maximum display depth of the dependency tree
#[arg(long, short, default_value_t = 255)]
pub depth: u8,
/// Prune the given package from the display of the dependency tree.
#[arg(long)]
pub prune: Vec<PackageName>,
/// Do not de-duplicate repeated dependencies.
/// Usually, when a package has already displayed its dependencies,
/// further occurrences will not re-display its dependencies,