commit dac49cd373aa33794e1060c760755f56df6b3184 parent 2e285f1bda556b783098c5d7588fcddbdc082d7c Author: JohnMcPMS <johnmcp@microsoft.com> Date: Fri, 17 Sep 2021 23:39:45 -0700 Make list show correlated source even when no upgrade is available (#1481) Diffstat:
| M | src/AppInstallerCLICore/Workflows/WorkflowBase.cpp | | | 27 | +++++++++++++++++++-------- |
1 file changed, 19 insertions(+), 8 deletions(-)
diff --git a/src/AppInstallerCLICore/Workflows/WorkflowBase.cpp b/src/AppInstallerCLICore/Workflows/WorkflowBase.cpp @@ -673,11 +673,16 @@ namespace AppInstaller::CLI::Workflow { Utility::LocIndString availableVersion, sourceName; - if (updateAvailable) + if (latestVersion) { - availableVersion = latestVersion->GetProperty(PackageVersionProperty::Version); + if (updateAvailable) + { + availableVersion = latestVersion->GetProperty(PackageVersionProperty::Version); + availableUpgradesCount++; + } + + // Always show the source for correlated packages sourceName = latestVersion->GetProperty(PackageVersionProperty::SourceName); - availableUpgradesCount++; } table.OutputLine({ @@ -696,14 +701,20 @@ namespace AppInstaller::CLI::Workflow if (table.IsEmpty()) { context.Reporter.Info() << Resource::String::NoInstalledPackageFound << std::endl; - } else if (m_onlyShowUpgrades) { - context.Reporter.Info() << availableUpgradesCount << ' ' << Resource::String::AvailableUpgrades << std::endl; } - - if (searchResult.Truncated) + else { - context.Reporter.Info() << '<' << Resource::String::SearchTruncated << '>' << std::endl; + if (searchResult.Truncated) + { + context.Reporter.Info() << '<' << Resource::String::SearchTruncated << '>' << std::endl; + } + + if (m_onlyShowUpgrades) + { + context.Reporter.Info() << availableUpgradesCount << ' ' << Resource::String::AvailableUpgrades << std::endl; + } } + } void EnsureMatchesFromSearchResult::operator()(Execution::Context& context) const