For most projects, we want to be able to pass some custom values when starting it.
The command line is then used to add this additional information.
We have ParamStr
and ParamCount
global functions, enough to retrieve the information. You may also use FindCmdLineSwitch
for something more easy to work with.
The Lazarus RTL offers some additional methods like hasOption
or getOptionValue
or checkOptions
in its TCustomApplication
class. Their are better, but not so easy to use, and not available on Delphi.
We just committed a new command line parser to our Open Source mORMot 2 framework, which works on both Delphi and FPC, follows both Windows and POSIX/Linux conventions, and has much more features (like automated generation of the help message), in an innovative and easy workflow.