浏览代码

uutlCommandLine: new function utlUsageProgramName

master
Martok 9 年前
父节点
当前提交
692be57e53
共有 1 个文件被更改,包括 9 次插入 和 1 次删除
  1. +9
    -1
      uutlCommandLine.pas

+ 9
- 1
uutlCommandLine.pas 查看文件

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


uses uses
getopts;
SysUtils, getopts;


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


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

implementation implementation


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


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

end. end.



正在加载...
取消
保存