From 84696d281c89acf3beac688d558bfd54ddb14dc5 Mon Sep 17 00:00:00 2001 From: Ruben Arts Date: Wed, 10 Apr 2024 10:16:31 +0200 Subject: [PATCH] fix: add env name if not default to tree and list command (#1145) --- src/cli/list.rs | 4 ++++ src/cli/tree.rs | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/src/cli/list.rs b/src/cli/list.rs index 1f4519edc..eae1bf599 100644 --- a/src/cli/list.rs +++ b/src/cli/list.rs @@ -206,6 +206,10 @@ pub async fn execute(args: Args) -> miette::Result<()> { // print packages as json json_packages(&packages_to_output, args.json_pretty); } else { + if !environment_name.is_default() { + eprintln!("Environment: {}", environment_name.fancy_display()); + } + // print packages as table print_packages_as_table(&packages_to_output).expect("an io error occurred"); } diff --git a/src/cli/tree.rs b/src/cli/tree.rs index 585b8ae50..829583634 100644 --- a/src/cli/tree.rs +++ b/src/cli/tree.rs @@ -92,6 +92,10 @@ pub async fn execute(args: Args) -> miette::Result<()> { let direct_deps = direct_dependencies(&environment, &platform); + if !environment_name.is_default() { + eprintln!("Environment: {}", environment_name.fancy_display()); + } + if args.invert { print_inverted_dependency_tree(&invert_dep_map(&dep_map), &direct_deps, &args.regex)?; } else {