Alexander c585c2f0cb Initial
Исходный код версии 2.0
2022-05-04 07:31:33 +03:00

65 lines
1.2 KiB
Plaintext

program cdejecter;
{$mode delphi}
{$codepage UTF8}
uses {$IFDEF UNIX}{$IFDEF UseCThreads}cthreads,{$ENDIF}{$ENDIF} Classes, SysUtils, CustApp;
type
{ TCDEjecter }
TCDEjecter = class(TCustomApplication)
protected
procedure DoRun; override;
public
constructor Create(TheOwner: TComponent); override;
destructor Destroy; override;
procedure WriteHelp; virtual;
end;
{ TCDEjecter }
procedure TCDEjecter.DoRun;
var
ErrorMsg: String;
begin
// quick check parameters
ErrorMsg:= CheckOptions('h', 'help');
if ErrorMsg <>'' then begin
ShowException(Exception.Create(ErrorMsg));
Terminate;
Exit;
end;
// parse parameters
if HasOption('h', 'help') then begin
WriteHelp;
Terminate;
Exit;
end;
{ add your program here }
// stop program loop
Terminate;
end;
constructor TCDEjecter.Create(TheOwner: TComponent);
begin
inherited Create (TheOwner);
StopOnException:= True;
end;
destructor TCDEjecter.Destroy;
begin
inherited Destroy;
end;
procedure TCDEjecter.WriteHelp;
begin
WriteLn('DEMO!');
writeln('Usage: ', ExeName, ' -h');
end;
var Application: TCDEjecter;
{$R *.res}
begin
Application:= TCDEjecter.Create(Nil);
Application.Title:= 'CD Ejecter';
Application.Run;
Application.Free;
end.