Browse Source

uutlCommandLine: new function utlUsageProgramName

master
Martok 7 years ago
parent
commit
692be57e53
1 changed files with 9 additions and 1 deletions
  1. +9
    -1
      uutlCommandLine.pas

+ 9
- 1
uutlCommandLine.pas View File

@@ -5,7 +5,7 @@ unit uutlCommandLine;
interface

uses
getopts;
SysUtils, getopts;

{ Forward definitions so getopts doesn't have to be used }
type
@@ -32,6 +32,9 @@ type
*)
function utlHandleAllOptions(ShortOpts : String; LongOpts : POptions; Handler: TOptionHandler): integer;

// Get program binary name suitable for Usage statements
function utlUsageProgramName: string;

implementation

function utlHandleAllOptions(ShortOpts : String; LongOpts : POptions; Handler: TOptionHandler): integer;
@@ -51,5 +54,10 @@ begin
Result:= getopts.OptInd;
end;

function utlUsageProgramName: string;
begin
Result:= ChangeFileExt(ExtractFileName(ParamStr(0)), '');
end;

end.


Loading…
Cancel
Save