Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Display documentations in show command #2212

Merged
merged 4 commits into from
Jun 2, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/AppInstallerCLICore/Resources.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
18 changes: 18 additions & 0 deletions src/AppInstallerCLICore/Workflows/ShowFlow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,24 @@ namespace AppInstaller::CLI::Workflow
{
info << Execution::ManifestInfoEmphasis << Resource::String::ShowLabelReleaseNotesUrl << ' ' << releaseNotesUrl << std::endl;
}
auto documentations = manifest.CurrentLocalization.Get<Manifest::Localization::Documentations>();
ryfu-msft marked this conversation as resolved.
Show resolved Hide resolved
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;
; }
ryfu-msft marked this conversation as resolved.
Show resolved Hide resolved

if (!documentation.DocumentUrl.empty())
ryfu-msft marked this conversation as resolved.
Show resolved Hide resolved
{
info << documentation.DocumentUrl << std::endl;
}
}
}

auto agreements = manifest.CurrentLocalization.Get<Manifest::Localization::Agreements>();
if (!agreements.empty())
{
Expand Down
3 changes: 3 additions & 0 deletions src/AppInstallerCLIPackage/Shared/Strings/en-us/winget.resw
Original file line number Diff line number Diff line change
Expand Up @@ -1337,4 +1337,7 @@ Please specify one of them using the `--source` option to proceed.</value>
<data name="UnableToPurgeInstallDirectory" xml:space="preserve">
<value>Cannot purge install directory, as it was not created by WinGet</value>
</data>
<data name="ShowLabelDocumentations" xml:space="preserve">
<value>Documentations:</value>
ryfu-msft marked this conversation as resolved.
Show resolved Hide resolved
</data>
</root>