[Lazarus] Parsing command line options

patspiper patspiper at gmail.com
Sat Sep 8 21:34:37 CEST 2012


On 08/09/12 21:53, Marco van de Voort wrote:
> On Sat, Sep 08, 2012 at 06:38:40PM +0300, patspiper wrote:
>> This is related to http://bugs.freepascal.org/view.php?id=22751
>> - What FPC/Lazarus functions are available to parse a command line
>> (where parameters begin with a dash)?
> Depends. Split arguments for TProcess use (like in the above bugreport):
> afaik none. Simply keep all arguments separate and pass them to the
> "parameters" propery.
Keeping arguments separate may not be possible: 
http://permalink.gmane.org/gmane.comp.ide.lazarus.general/64781

However, splitting the command line with the separator being an unquoted 
space should be good enough. This would even work with a gdb option such 
as the -b (baudrate).
Ex: gdb -b 9600
     Process1.Parameters.Add('-b');
     Process1.Parameters.Add('9600');
The above seems to work.

Stephano




More information about the Lazarus mailing list