From 22db01c93b5a082b3de67b4fe72cf90dc9b9cb42 Mon Sep 17 00:00:00 2001 From: Ryan Fu Date: Wed, 1 Jun 2022 14:37:37 -0700 Subject: [PATCH 1/2] Add documentations to show flow --- src/AppInstallerCLICore/Resources.h | 1 + src/AppInstallerCLICore/Workflows/ShowFlow.cpp | 18 ++++++++++++++++++ .../Shared/Strings/en-us/winget.resw | 3 +++ 3 files changed, 22 insertions(+) diff --git a/src/AppInstallerCLICore/Resources.h b/src/AppInstallerCLICore/Resources.h index cd12634abb..b5b13bc77c 100644 --- a/src/AppInstallerCLICore/Resources.h +++ b/src/AppInstallerCLICore/Resources.h @@ -259,6 +259,7 @@ namespace AppInstaller::CLI::Resource WINGET_DEFINE_RESOURCE_STRINGID(ShowLabelCopyrightUrl); WINGET_DEFINE_RESOURCE_STRINGID(ShowLabelDependencies); WINGET_DEFINE_RESOURCE_STRINGID(ShowLabelDescription); + WINGET_DEFINE_RESOURCE_STRINGID(ShowLabelDocumentations); WINGET_DEFINE_RESOURCE_STRINGID(ShowLabelExternalDependencies); WINGET_DEFINE_RESOURCE_STRINGID(ShowLabelInstaller); WINGET_DEFINE_RESOURCE_STRINGID(ShowLabelInstallerLocale); diff --git a/src/AppInstallerCLICore/Workflows/ShowFlow.cpp b/src/AppInstallerCLICore/Workflows/ShowFlow.cpp index fdf0e9dad5..b27499994f 100644 --- a/src/AppInstallerCLICore/Workflows/ShowFlow.cpp +++ b/src/AppInstallerCLICore/Workflows/ShowFlow.cpp @@ -90,6 +90,24 @@ namespace AppInstaller::CLI::Workflow { info << Execution::ManifestInfoEmphasis << Resource::String::ShowLabelReleaseNotesUrl << ' ' << releaseNotesUrl << std::endl; } + auto documentations = manifest.CurrentLocalization.Get(); + if (!documentations.empty()) + { + context.Reporter.Info() << Execution::ManifestInfoEmphasis << Resource::String::ShowLabelDocumentations << std::endl; + for (const auto& documentation : documentations) + { + if (!documentation.DocumentLabel.empty()) + { + info << Execution::ManifestInfoEmphasis << documentation.DocumentLabel << ": "_liv; +; } + + if (!documentation.DocumentUrl.empty()) + { + info << documentation.DocumentUrl << std::endl; + } + } + } + auto agreements = manifest.CurrentLocalization.Get(); if (!agreements.empty()) { diff --git a/src/AppInstallerCLIPackage/Shared/Strings/en-us/winget.resw b/src/AppInstallerCLIPackage/Shared/Strings/en-us/winget.resw index be5a075a7c..a978146c00 100644 --- a/src/AppInstallerCLIPackage/Shared/Strings/en-us/winget.resw +++ b/src/AppInstallerCLIPackage/Shared/Strings/en-us/winget.resw @@ -1337,4 +1337,7 @@ Please specify one of them using the `--source` option to proceed. Cannot purge install directory, as it was not created by WinGet + + Documentations: + \ No newline at end of file From 6a04b58ed791fde025e877537c003aece597cd79 Mon Sep 17 00:00:00 2001 From: Ryan Fu Date: Wed, 1 Jun 2022 15:07:27 -0700 Subject: [PATCH 2/2] fix nit and add comment to string --- src/AppInstallerCLICore/Workflows/ShowFlow.cpp | 2 +- src/AppInstallerCLIPackage/Shared/Strings/en-us/winget.resw | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/AppInstallerCLICore/Workflows/ShowFlow.cpp b/src/AppInstallerCLICore/Workflows/ShowFlow.cpp index b27499994f..c943af9173 100644 --- a/src/AppInstallerCLICore/Workflows/ShowFlow.cpp +++ b/src/AppInstallerCLICore/Workflows/ShowFlow.cpp @@ -99,7 +99,7 @@ namespace AppInstaller::CLI::Workflow if (!documentation.DocumentLabel.empty()) { info << Execution::ManifestInfoEmphasis << documentation.DocumentLabel << ": "_liv; -; } + } if (!documentation.DocumentUrl.empty()) { diff --git a/src/AppInstallerCLIPackage/Shared/Strings/en-us/winget.resw b/src/AppInstallerCLIPackage/Shared/Strings/en-us/winget.resw index a978146c00..07b0ad8bc2 100644 --- a/src/AppInstallerCLIPackage/Shared/Strings/en-us/winget.resw +++ b/src/AppInstallerCLIPackage/Shared/Strings/en-us/winget.resw @@ -1339,5 +1339,6 @@ Please specify one of them using the `--source` option to proceed. Documentations: + Label for the list of documentation links relevant to the package \ No newline at end of file