File tree Expand file tree Collapse file tree 1 file changed +15
-3
lines changed
Expand file tree Collapse file tree 1 file changed +15
-3
lines changed Original file line number Diff line number Diff line change @@ -316,7 +316,7 @@ procedure TCommandLineParser.InternalValidate(const parseResult: IInternalParseR
316316 begin
317317 if not (option as IOptionDefInvoke).WasFound then
318318 begin
319- parseResult.AddError(' Required Option [' + option.LongName + ' ] was not specified' );
319+ parseResult.AddError(' Required option [' + option.LongName + ' ] was not specified' );
320320 end ;
321321 end ;
322322 end ;
@@ -327,21 +327,33 @@ procedure TCommandLineParser.InternalValidate(const parseResult: IInternalParseR
327327 begin
328328 if not (option as IOptionDefInvoke).WasFound then
329329 begin
330- parseResult.AddError(' Missing required unnamed parameter(s) ' );
330+ parseResult.AddError(' Required parameter < ' + option.ShortName + ' > was not specified ' );
331331 Break;
332332 end ;
333333 end ;
334334 end ;
335335
336336 if parseResult.command <> nil then
337337 begin
338+ for option in parseResult.command.RegisteredUnamedOptions do
339+ begin
340+ if option.Required then
341+ begin
342+ if not (option as IOptionDefInvoke).WasFound then
343+ begin
344+ parseResult.AddError(' Required parameter <' + option.ShortName + ' > was not specified' );
345+ Break;
346+ end ;
347+ end ;
348+ end ;
349+
338350 for option in parseResult.command.RegisteredOptions do
339351 begin
340352 if option.Required then
341353 begin
342354 if not (option as IOptionDefInvoke).WasFound then
343355 begin
344- parseResult.AddError(' Required Option [' + option.LongName + ' ] was not specified' );
356+ parseResult.AddError(' Required option [' + option.LongName + ' ] was not specified' );
345357 end ;
346358 end ;
347359 end ;
You can’t perform that action at this time.
0 commit comments