From 73ff38e72ee17b0d2e1332d2043bfddb89a77ae3 Mon Sep 17 00:00:00 2001 From: shameer99 Date: Mon, 3 May 2021 11:26:19 -0400 Subject: [PATCH] Have auto version option match help option checks for version error and uses same onError func as help option. --- src/CommandLine/Text/HelpText.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/CommandLine/Text/HelpText.cs b/src/CommandLine/Text/HelpText.cs index f5e9a7b9..e5983007 100644 --- a/src/CommandLine/Text/HelpText.cs +++ b/src/CommandLine/Text/HelpText.cs @@ -349,7 +349,7 @@ public static HelpText AutoBuild( if (onError != null && parserResult.Tag == ParserResultType.NotParsed) { errors = ((NotParsed)parserResult).Errors; - if (errors.IsHelp() || errors.OnlyMeaningfulOnes().Any()) + if (errors.IsHelp() || errors.IsVersion() || errors.OnlyMeaningfulOnes().Any()) auto = onError(auto); }