From e03caceaf5fba058b09f38a020242930e9578b8e Mon Sep 17 00:00:00 2001 From: Easton Pillay Date: Fri, 15 Oct 2021 10:07:38 -0400 Subject: [PATCH 1/3] Made it so the source column doesn't show if source was specified (for list and upgrade). --- src/AppInstallerCLICore/Workflows/WorkflowBase.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/AppInstallerCLICore/Workflows/WorkflowBase.cpp b/src/AppInstallerCLICore/Workflows/WorkflowBase.cpp index 3d998125ec..3315633ffe 100644 --- a/src/AppInstallerCLICore/Workflows/WorkflowBase.cpp +++ b/src/AppInstallerCLICore/Workflows/WorkflowBase.cpp @@ -648,6 +648,8 @@ namespace AppInstaller::CLI::Workflow { auto& searchResult = context.Get(); + bool singleSourceSpecified = context.Args.Contains(Execution::Args::Type::Source); + Execution::TableOutput<5> table(context.Reporter, { Resource::String::SearchName, @@ -690,7 +692,7 @@ namespace AppInstaller::CLI::Workflow match.Package->GetProperty(PackageProperty::Id), installedVersion->GetProperty(PackageVersionProperty::Version), availableVersion, - sourceName + singleSourceSpecified ? ""s : sourceName }); } } From 14b4260167aa771c633083fdb4e598b2c37ee4af Mon Sep 17 00:00:00 2001 From: Easton Pillay Date: Fri, 15 Oct 2021 10:11:04 -0400 Subject: [PATCH 2/3] Yeah, that variable was unnecessary. --- src/AppInstallerCLICore/Workflows/WorkflowBase.cpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/AppInstallerCLICore/Workflows/WorkflowBase.cpp b/src/AppInstallerCLICore/Workflows/WorkflowBase.cpp index 3315633ffe..5abb0b4676 100644 --- a/src/AppInstallerCLICore/Workflows/WorkflowBase.cpp +++ b/src/AppInstallerCLICore/Workflows/WorkflowBase.cpp @@ -648,8 +648,6 @@ namespace AppInstaller::CLI::Workflow { auto& searchResult = context.Get(); - bool singleSourceSpecified = context.Args.Contains(Execution::Args::Type::Source); - Execution::TableOutput<5> table(context.Reporter, { Resource::String::SearchName, @@ -692,7 +690,7 @@ namespace AppInstaller::CLI::Workflow match.Package->GetProperty(PackageProperty::Id), installedVersion->GetProperty(PackageVersionProperty::Version), availableVersion, - singleSourceSpecified ? ""s : sourceName + context.Args.Contains(Execution::Args::Type::Source) ? ""s : sourceName }); } } From 90ee5e4a31432343e9205239d452c73fcd7f23c8 Mon Sep 17 00:00:00 2001 From: Easton Pillay Date: Fri, 15 Oct 2021 14:45:54 -0400 Subject: [PATCH 3/3] Added changes from code review. --- src/AppInstallerCLICore/Workflows/WorkflowBase.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/AppInstallerCLICore/Workflows/WorkflowBase.cpp b/src/AppInstallerCLICore/Workflows/WorkflowBase.cpp index 5abb0b4676..14603ae67b 100644 --- a/src/AppInstallerCLICore/Workflows/WorkflowBase.cpp +++ b/src/AppInstallerCLICore/Workflows/WorkflowBase.cpp @@ -658,6 +658,8 @@ namespace AppInstaller::CLI::Workflow }); int availableUpgradesCount = 0; + auto &source = context.Get(); + bool shouldShowSource = source->IsComposite() && source->GetAvailableSources().size() > 1; for (const auto& match : searchResult.Matches) { @@ -690,7 +692,7 @@ namespace AppInstaller::CLI::Workflow match.Package->GetProperty(PackageProperty::Id), installedVersion->GetProperty(PackageVersionProperty::Version), availableVersion, - context.Args.Contains(Execution::Args::Type::Source) ? ""s : sourceName + shouldShowSource ? sourceName : ""s }); } }