Lazarus

Free Pascal => Beginners => Topic started by: Pluto on March 26, 2021, 03:06:23 am

Title: TCustomApplication.GetNonOptions behaves oddly
Post by: Pluto on March 26, 2021, 03:06:23 am
On Windows, for:

> MyApp.exe --clone=asdf

The following line:

NonOptions:=GetNonOptions('h',['help','clone','sync']);

throws:

Exception at 000000010002C457: EListError:
Option at position 1 does not allow an argument: clone.

Any ideas?
Title: Re: TCustomApplication.GetNonOptions behaves oddly
Post by: engkin on March 26, 2021, 03:38:28 am
Try:
Code: Pascal  [Select][+][-]
  1. NonOptions:=GetNonOptions('h',['help','clone:','sync']);

If it takes a value add a single colon :
If the value is optional, add two colons ::

Check the examples in the same folder of the package where TCustomApplication is defined.
Title: Re: TCustomApplication.GetNonOptions behaves oddly
Post by: Pluto on March 26, 2021, 04:11:41 pm
Awesome. Thank you.
TinyPortal © 2005-2018