-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Make exe missing silent switch a warning and add tool info #93
Changes from 2 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -27,8 +27,9 @@ namespace AppInstaller::CLI | |
void Command::OutputIntroHeader(Execution::Reporter& reporter) const | ||
{ | ||
reporter.Info() << | ||
"AppInstaller Command Line v" << Runtime::GetClientVersion() << std::endl << | ||
"Copyright (c) Microsoft Corporation" << std::endl; | ||
"Windows Package Manager" << std::endl << | ||
" Version: " << Runtime::GetClientVersion() << std::endl << | ||
" Copyright: Copyright (c) Microsoft Corporation. All rights reserved." << std::endl; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't like the change to this format. #Closed There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Indeed, the goal of the change was not to affect this, but to add --info. Please revert your format changes to this part. In reply to: 417634511 [](ancestors = 417634511) |
||
} | ||
|
||
void Command::OutputHelp(Execution::Reporter& reporter, const CommandException* exception) const | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -30,6 +30,7 @@ namespace AppInstaller::CLI | |
return | ||
{ | ||
Argument{ "version", 'v', Execution::Args::Type::ListVersions, LOCME("Display the version of the tool"), ArgumentType::Flag, Visibility::Help }, | ||
Argument{ "info", APPINSTALLER_CLI_ARGUMENT_NO_SHORT_VER, Execution::Args::Type::Info, LOCME("Display general info of the tool"), ArgumentType::Flag, Visibility::Help }, | ||
}; | ||
} | ||
|
||
|
@@ -40,9 +41,20 @@ namespace AppInstaller::CLI | |
|
||
void RootCommand::ExecuteInternal(Execution::Context& context) const | ||
{ | ||
if (context.Args.Contains(Execution::Args::Type::ListVersions)) | ||
if (context.Args.Contains(Execution::Args::Type::Info)) | ||
{ | ||
context.Reporter.Info() << 'v' << Runtime::GetClientVersion() << std::endl; | ||
OutputIntroHeader(context.Reporter); | ||
|
||
context.Reporter.Info() << std::endl << | ||
"Links:" << std::endl << | ||
" Privacy Statement: https://aka.ms/winget-privacy" << std::endl << | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
We typically only use 2 spaces for indentation. I would stick with that here. #Closed |
||
" License agreement: https://aka.ms/winget-license" << std::endl << | ||
" 3rd Party Notices: https://aka.ms/winget-3rdPartyNotice" << std::endl << | ||
" Homepage: https://aka.ms/mspm" << std::endl; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Kevin mentioned we should use aka.ms/winget #Closed There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Also, given that the others line up nicely, I think it would look better if this URL also lined up. In reply to: 417636108 [](ancestors = 417636108,417598643) |
||
} | ||
else if (context.Args.Contains(Execution::Args::Type::ListVersions)) | ||
{ | ||
context.Reporter.Info() << "Version: " << Runtime::GetClientVersion() << std::endl; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Don't change this either. #Closed |
||
} | ||
else | ||
{ | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -36,12 +36,20 @@ namespace AppInstaller::CLI | |
|
||
try | ||
{ | ||
(void)Manifest::Manifest::CreateFromPath(inputFile, true); | ||
(void)Manifest::Manifest::CreateFromPath(inputFile, true, true); | ||
context.Reporter.Info() << "Manifest validation succeeded." << std::endl; | ||
} | ||
catch (const Manifest::ManifestException& e) | ||
{ | ||
context.Reporter.Warn() << "Manifest validation failed." << std::endl; | ||
if (e.IsWarningOnly()) | ||
{ | ||
context.Reporter.Info() << "Manifest validation succeeded with warnings." << std::endl; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Warn #Closed |
||
} | ||
else | ||
{ | ||
context.Reporter.Warn() << "Manifest validation failed." << std::endl; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Error #Closed |
||
} | ||
|
||
context.Reporter.Warn() << e.GetManifestErrorMessage() << std::endl; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Either match the above, or just use Info. #Closed |
||
} | ||
}; | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -59,7 +59,7 @@ namespace AppInstaller::Manifest | |
(Switches.find(InstallerSwitchType::SilentWithProgress) == Switches.end() || | ||
Switches.find(InstallerSwitchType::Silent) == Switches.end())) | ||
{ | ||
resultErrors.emplace_back(ManifestError::ExeInstallerMissingSilentSwitches); | ||
resultErrors.emplace_back(ManifestError::ExeInstallerMissingSilentSwitches, "", "", -1, -1, ValidationError::Level::Warning); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
An overload is nicer than pushing defaults out into the call sites. #Closed There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Or if you do push defaults out, they should probably be through an indirection rather than the actual values. In reply to: 417640546 [](ancestors = 417640546) |
||
} | ||
|
||
// Check empty string before calling IsValidUrl to avoid duplicate error reporting. | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't this be WinGet? #ByDesign
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's the string from the bug description. I guess our official name is still Windows Package Manager?
In reply to: 417084682 [](ancestors = 417084682)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll follow up with Kevin to confirm
In reply to: 417589933 [](ancestors = 417589933,417084682)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Kevin confirmed Windows Package Manager is the correct name
In reply to: 417590437 [](ancestors = 417590437,417589933,417084682)