[fpc-pascal] CLI argument parsers (was: Resource compilation)

Michael Van Canneyt michael at freepascal.org
Mon Jan 14 08:23:29 CET 2019



On Mon, 14 Jan 2019, Martok wrote:

> Am 13.01.2019 um 18:43 schrieb Michael Van Canneyt:
>> Assuming you mean the command-line arguments:
>> 
>> What's wrong/missing with the functionality in TCustomApplication ?
> Other than that nobody in the wild seems to fully use it? ;-)

Your count is a little biased. A total of 41 examples/tools use it. 
14 utils distributed in the FPC tree use it.

home:~/fpc/packages> grep -i TCustomApplication */examples/*.* */tests/*.* ../utils/*.* ../utils/*/*.* | wc -l
41
home:~/fpc/packages> grep -i TCustomApplication  ../utils/*.* ../utils/*/*.* | wc -l
14

There is a lazarus IDE wizard for a console application. 
Every Lazarus LCL application has it built-in. So it is used "in the wild".

The bare compiler tools do not use it because 
a) They predate TCustomApplication
b) It introduces a dependency on something which is not in the RTL but in packages.

So that it's not used is simply incorrect. It's more used than the posix-y getopts
unit which is also present in the fpc tree.

You simply didn't know about it, most probably.

You're welcome to suggest improvements, but as your rightly observed, 
we should not introduce another system.

Michael.



More information about the fpc-pascal mailing list