winget-cli

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | README | LICENSE

commit d6b2a061265b685541e70c1d9ebfa878cd819776
parent 3b238824043143ee85546ee4a6af2661c0864e0c
Author: yao-msft <50888816+yao-msft@users.noreply.github.com>
Date:   Fri,  8 May 2020 12:13:27 -0700

Show command should not show empty entries (#113)


Diffstat:
Msrc/AppInstallerCLICore/Workflows/ShowFlow.cpp | 37+++++++++++++++++++++++++++++--------
1 file changed, 29 insertions(+), 8 deletions(-)

diff --git a/src/AppInstallerCLICore/Workflows/ShowFlow.cpp b/src/AppInstallerCLICore/Workflows/ShowFlow.cpp @@ -20,18 +20,39 @@ namespace AppInstaller::CLI::Workflow // TODO: Come up with a prettier format context.Reporter.Info() << "Version: " << manifest.Version << std::endl; - context.Reporter.Info() << "Author: " << manifest.Author << std::endl; context.Reporter.Info() << "Publisher: " << manifest.Publisher << std::endl; - context.Reporter.Info() << "AppMoniker: " << manifest.AppMoniker << std::endl; - context.Reporter.Info() << "Description: " << selectedLocalization.Description << std::endl; - context.Reporter.Info() << "Homepage: " << selectedLocalization.Homepage << std::endl; - context.Reporter.Info() << "License: " << manifest.License << std::endl; - context.Reporter.Info() << "License Url: " << selectedLocalization.LicenseUrl << std::endl; - context.Reporter.Info() << "Installer:" << std::endl; + if (!manifest.Author.empty()) + { + context.Reporter.Info() << "Author: " << manifest.Author << std::endl; + } + if (!manifest.AppMoniker.empty()) + { + context.Reporter.Info() << "AppMoniker: " << manifest.AppMoniker << std::endl; + } + if (!selectedLocalization.Description.empty()) + { + context.Reporter.Info() << "Description: " << selectedLocalization.Description << std::endl; + } + if (!selectedLocalization.Homepage.empty()) + { + context.Reporter.Info() << "Homepage: " << selectedLocalization.Homepage << std::endl; + } + if (!manifest.License.empty()) + { + context.Reporter.Info() << "License: " << manifest.License << std::endl; + } + if (!selectedLocalization.LicenseUrl.empty()) + { + context.Reporter.Info() << "License Url: " << selectedLocalization.LicenseUrl << std::endl; + } + context.Reporter.Info() << "Installer:" << std::endl; if (installer) { - context.Reporter.Info() << " Language: " << installer->Language << std::endl; + if (!installer->Language.empty()) + { + context.Reporter.Info() << " Language: " << installer->Language << std::endl; + } context.Reporter.Info() << " SHA256: " << Utility::SHA256::ConvertToString(installer->Sha256) << std::endl; context.Reporter.Info() << " Download Url: " << installer->Url << std::endl; context.Reporter.Info() << " Type: " << Manifest::ManifestInstaller::InstallerTypeToString(installer->InstallerType) << std::endl;