diff --git a/ManyConsole.CommandLineUtils/ConsoleCommand.cs b/ManyConsole.CommandLineUtils/ConsoleCommand.cs index eff9662..009ddce 100644 --- a/ManyConsole.CommandLineUtils/ConsoleCommand.cs +++ b/ManyConsole.CommandLineUtils/ConsoleCommand.cs @@ -64,6 +64,15 @@ internal void Register(CommandLineApplication app) return 2; } + if(RemainingArgumentsCount != 0){ + var actCount =(remainingArgs?.Values.Count() ?? 0); + if(actCount < RemainingArgumentsCount){ + c.Out.WriteLine("Invalid number of arguments-- expected {1} more.", RemainingArgumentsCount - actCount); + c.ShowHelp(); + return 2; + } + } + return Run(remainingArgs?.Values.ToArray() ?? new string []{}); }); }); diff --git a/ManyConsole.CommandLineUtils/ManyConsole.CommandLineUtils.csproj b/ManyConsole.CommandLineUtils/ManyConsole.CommandLineUtils.csproj index c748714..b3f6f63 100644 --- a/ManyConsole.CommandLineUtils/ManyConsole.CommandLineUtils.csproj +++ b/ManyConsole.CommandLineUtils/ManyConsole.CommandLineUtils.csproj @@ -5,8 +5,8 @@ A near drop-in replacement for ManyConsole, wrapping Microsoft.Extensions.CommandLineUtils Jay Tuley, Frank Schwieterman, Jonathan Pryor Copyright 2017 - 1.0.2.0 - 1.0.2.0 + 1.0.3.0 + 1.0.3.0 https://github.com/jbtule/ManyConsole.CommandLineUtils https://github.com/jbtule/ManyConsole.CommandLineUtils/blob/master/LICENSE.txt command-line console parsing manyconsole ndesk CommandLineUtils @@ -14,7 +14,7 @@ True True True - 1.0.2-alpha + 1.0.3-alpha