|
@@ -14,9 +14,13 @@
|
|
|
|
|
|
**********************************************************************}
|
|
|
unit getopts;
|
|
|
-Interface
|
|
|
+
|
|
|
{$modeswitch advancedrecords}
|
|
|
{$modeswitch defaultparameters}
|
|
|
+{$h+}
|
|
|
+
|
|
|
+Interface
|
|
|
+
|
|
|
Const
|
|
|
No_Argument = 0;
|
|
|
Required_Argument = 1;
|
|
@@ -51,11 +55,6 @@ 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}
|
|
|
{***************************************************************************
|
|
@@ -147,6 +146,20 @@ end;
|
|
|
|
|
|
{$ENDIF}
|
|
|
|
|
|
+function strpas(p : pchar) : ansistring;
|
|
|
+
|
|
|
+begin
|
|
|
+ if p=nil then
|
|
|
+ strpas:=''
|
|
|
+ else
|
|
|
+ strpas:=p;
|
|
|
+end;
|
|
|
+
|
|
|
+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;
|
|
|
+
|
|
|
{***************************************************************************
|
|
|
Real Getopts
|
|
|
***************************************************************************}
|