Sign in Join
FPDoc Onlineexperiment

TCustomApplication.GetOptionValue function

Member of TCustomApplicationpublicIn unit CustApp

Return the value of a command-line option.

Declaration

pascal
function GetOptionValue(const S: string): string
function GetOptionValue(const C: char; const S: string): string

Arguments

S

Long option string.

C

Short option character.

Function result

Option value, or empty string.

Description

GetOptionValue returns the value of an option. Values are specified in the usual GNU option format, either of

--longopt=Value

or

-c Value

is supported.

The function returns the specified value, or the empty string if none was specified.

Depending on the value of the CaseSensitiveOptions property, the search is performed case sensitive or case insensitive.

Options are identified as command-line parameters which start with OptionChar (by default the dash ('-') character).

If an option can appear multiple times, use GetOptionValues to retrieve all values. This function only returns the value of the first occurrence of an option.

See also

An experiment, built from development snapshots. Not the official Free Pascal or Lazarus documentation.