program cdejecter;
{$mode delphi}
{$codepage UTF8}
uses Interfaces, {$IFDEF UNIX}{$IFDEF UseCThreads}cthreads,{$ENDIF}{$ENDIF} Classes, SysUtils, CustApp, ANBFormatString,
     cde_lang;
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
WriteLn('--------------------------------------------------------------------');
WriteLn('**************************** CD Ejecter ****************************');
WriteLn('*************************** Версия: 1.2  ***************************');
WriteLn('******* Авторские права (c) 2011 - 2017, Александр Бабаев **********');
WriteLn('--------------------------------------------------------------------');
// 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(FormatStr(GetLocalizedString(cde_messages_help), ['$newline$'], [#13#10]));
end;
var Application: TCDEjecter;
{$R *.res}
begin
Application:= TCDEjecter.Create(Nil);
Application.Title:= 'CD Ejecter';
Application.Run;
Application.Free;
end.
