Skip to content

Commit

Permalink
Ignore NoVerbSelected commandline parsing error (#135)
Browse files Browse the repository at this point in the history
* Ignore noverbselected parsing errors

* changed to notparsed
  • Loading branch information
ryfu-msft authored Aug 19, 2021
1 parent 5b4e7b6 commit 0c6a474
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions src/WingetCreateCLI/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -108,14 +108,17 @@ private static void DisplayHelp(NotParsed<object> result)
Console.WriteLine();
}

private static void DisplayParsingErrors<T>(ParserResult<T> result)
private static void DisplayParsingErrors<T>(NotParsed<T> result)
{
var builder = SentenceBuilder.Create();
var errorMessages = HelpText.RenderParsingErrorsTextAsLines(result, builder.FormatError, builder.FormatMutuallyExclusiveSetErrors, 1);

foreach (var error in errorMessages)
if (!result.Errors.Any(e => e is NoVerbSelectedError))
{
Logger.Warn(error);
var builder = SentenceBuilder.Create();
var errorMessages = HelpText.RenderParsingErrorsTextAsLines(result, builder.FormatError, builder.FormatMutuallyExclusiveSetErrors, 1);

foreach (var error in errorMessages)
{
Logger.Warn(error);
}
}
}
}
Expand Down

0 comments on commit 0c6a474

Please sign in to comment.