mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-14 10:20:21 +02:00
* helper in record to make setting parameters a bit denser.
git-svn-id: trunk@42147 -
This commit is contained in:
parent
9313ddea78
commit
646d7c2a95
@ -15,7 +15,8 @@
|
||||
**********************************************************************}
|
||||
unit getopts;
|
||||
Interface
|
||||
|
||||
{$modeswitch advancedrecords}
|
||||
{$modeswitch defaultparameters}
|
||||
Const
|
||||
No_Argument = 0;
|
||||
Required_Argument = 1;
|
||||
@ -29,6 +30,7 @@ Type
|
||||
Has_arg : Integer;
|
||||
Flag : PChar;
|
||||
Value : Char;
|
||||
Procedure SetOption(const aName:String;AHas_Arg:integer=0;AFlag:PChar=nil;AValue:Char=#0);
|
||||
end;
|
||||
|
||||
Orderings = (require_order,permute,return_in_order);
|
||||
@ -48,6 +50,13 @@ Function GetLongOpts (ShortOpts : String;LongOpts : POption;var Longind : Longin
|
||||
|
||||
Implementation
|
||||
|
||||
|
||||
Procedure TOption.SetOption(const aName:String;AHas_Arg:integer=0;AFlag:PChar=nil;AValue:Char=#0);
|
||||
begin
|
||||
Name:=aName; Has_Arg:=AHas_Arg; Flag:=AFlag; Value:=Avalue;
|
||||
end;
|
||||
|
||||
|
||||
{$IFNDEF FPC}
|
||||
{***************************************************************************
|
||||
Create an ArgV
|
||||
|
Loading…
Reference in New Issue
Block a user