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

Fix help text bugs #154

Merged
merged 2 commits into from
Sep 2, 2021
Merged
Show file tree
Hide file tree
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
3 changes: 1 addition & 2 deletions src/WingetCreateCLI/Commands/UpdateCommand.cs
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,7 @@ public static IEnumerable<Example> Examples
{
get
{
yield return new Example(Resources.Example_UpdateCommand_SearchAndUpdateVersion, new UpdateCommand { Id = "<PackageIdentifier>", Version = "<Version>" });
yield return new Example(Resources.Example_UpdateCommand_SearchAndUpdateInstallerURL, new UpdateCommand { Id = "<PackageIdentifier>", InstallerUrls = new string[] { "<InstallerUrl1>", "<InstallerUrl2>" } });
yield return new Example(Resources.Example_UpdateCommand_SearchAndUpdateVersionAndInstallerURL, new UpdateCommand { Id = "<PackageIdentifier>", InstallerUrls = new string[] { "<InstallerUrl1>", "<InstallerUrl2>" }, Version = "<Version>" });
yield return new Example(Resources.Example_UpdateCommand_SaveAndPublish, new UpdateCommand { Id = "<PackageIdentifier>", Version = "<Version>", OutputDir = "<OutputDirectory>", GitHubToken = "<GitHubPersonalAccessToken>" });
}
}
Expand Down
5 changes: 4 additions & 1 deletion src/WingetCreateCLI/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,10 @@ private static void DisplayHelp(NotParsed<object> result)

private static void DisplayParsingErrors<T>(NotParsed<T> result)
{
if (!result.Errors.Any(e => e is NoVerbSelectedError))
if (!result.Errors.Any(
e => e is NoVerbSelectedError ||
(e is BadVerbSelectedError badVerbError && badVerbError.Token == "-?") ||
(e is UnknownOptionError unknownOptionError && unknownOptionError.Token == "?")))
{
var builder = SentenceBuilder.Create();
var errorMessages = HelpText.RenderParsingErrorsTextAsLines(result, builder.FormatError, builder.FormatMutuallyExclusiveSetErrors, 1);
Expand Down
15 changes: 3 additions & 12 deletions src/WingetCreateCLI/Properties/Resources.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 3 additions & 7 deletions src/WingetCreateCLI/Properties/Resources.resx
Original file line number Diff line number Diff line change
Expand Up @@ -206,13 +206,9 @@
<data name="Example_UpdateCommand_SaveAndPublish" xml:space="preserve">
<value>Save and publish updated manifest</value>
</data>
<data name="Example_UpdateCommand_SearchAndUpdateInstallerURL" xml:space="preserve">
<value>Search for an existing manifest and update the installer url</value>
<comment>Describes a usage scenario for the Update Command that pulls down a manifest by ID and updates the installer URL field with the value provided by the user.</comment>
</data>
<data name="Example_UpdateCommand_SearchAndUpdateVersion" xml:space="preserve">
<value>Search for an existing manifest and update the version</value>
<comment>Describes a usage scenario for the Update Command that pulls down a manifest by ID and updates the Version field with the value provided by the user.</comment>
<data name="Example_UpdateCommand_SearchAndUpdateVersionAndInstallerURL" xml:space="preserve">
<value>Search for an existing manifest and update the installer url and version</value>
<comment>Describes a usage scenario for the Update Command that pulls down a manifest by ID and updates the installer URL field and version field with the values provided by the user.</comment>
</data>
<data name="FileExtensions_KeywordDescription" xml:space="preserve">
<value>List of file extensions the package could support</value>
Expand Down