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

Move Release Notes to new line and indent #2312

Merged
merged 6 commits into from
Jul 11, 2022
Merged
Changes from all commits
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
23 changes: 20 additions & 3 deletions src/AppInstallerCLICore/Workflows/ShowFlow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,25 @@

using namespace AppInstaller::Repository;
using namespace AppInstaller::CLI;
using namespace AppInstaller::Utility;
using namespace AppInstaller::Utility::literals;

namespace {
void ShowMultiLineField(Execution::OutputStream& outputStream, AppInstaller::StringResource::StringId label, std::string& value)
{
bool isMultiLine = FindAndReplace(value, "\n", "\n ");
outputStream << Execution::ManifestInfoEmphasis << label;
if (isMultiLine)
{
outputStream << std::endl << " "_liv << value << std::endl;
}
else
{
outputStream << ' ' << value << std::endl;
}
}
}

namespace AppInstaller::CLI::Workflow
{
void ShowManifestInfo(Execution::Context& context)
Expand Down Expand Up @@ -52,7 +69,7 @@ namespace AppInstaller::CLI::Workflow
}
if (!description.empty())
{
info << Execution::ManifestInfoEmphasis << Resource::String::ShowLabelDescription << ' ' << description << std::endl;
ShowMultiLineField(info, Resource::String::ShowLabelDescription, description);
}
auto homepage = manifest.CurrentLocalization.Get<Manifest::Localization::PackageUrl>();
if (!homepage.empty())
Expand Down Expand Up @@ -83,7 +100,7 @@ namespace AppInstaller::CLI::Workflow
auto releaseNotes = manifest.CurrentLocalization.Get<Manifest::Localization::ReleaseNotes>();
if (!releaseNotes.empty())
{
info << Execution::ManifestInfoEmphasis << Resource::String::ShowLabelReleaseNotes << ' ' << releaseNotes << std::endl;
ShowMultiLineField(info, Resource::String::ShowLabelReleaseNotes, releaseNotes);
}
auto releaseNotesUrl = manifest.CurrentLocalization.Get<Manifest::Localization::ReleaseNotesUrl>();
if (!releaseNotesUrl.empty())
Expand All @@ -93,7 +110,7 @@ namespace AppInstaller::CLI::Workflow
auto installationNotes = manifest.CurrentLocalization.Get<Manifest::Localization::InstallationNotes>();
if (!installationNotes.empty())
{
info << Execution::ManifestInfoEmphasis << Resource::String::ShowLabelInstallationNotes << ' ' << installationNotes << std::endl;
ShowMultiLineField(info, Resource::String::ShowLabelInstallationNotes, installationNotes);
}
const auto& documentations = manifest.CurrentLocalization.Get<Manifest::Localization::Documentations>();
if (!documentations.empty())
Expand Down