+ allow specifying the output file as a second parameter

git-svn-id: branches/z80@44597 -
This commit is contained in:
nickysn 2020-04-05 16:07:11 +00:00
parent 4b19f323d5
commit e1e96099c4

View File

@ -83,14 +83,16 @@ begin
Terminate; Terminate;
Exit; Exit;
end; end;
if Length(NonOptions) > 1 then if Length(NonOptions) > 2 then
begin begin
ShowException(Exception.Create('Too many files specified')); ShowException(Exception.Create('Too many files specified'));
Terminate; Terminate;
Exit; Exit;
end; end;
FInputFileName := NonOptions[0]; FInputFileName := NonOptions[0];
if FOutputFileName = '' then if Length(NonOptions) >= 2 then
FOutputFileName := NonOptions[1]
else
FOutputFileName := ChangeFileExt(FInputFileName, '.tzx'); FOutputFileName := ChangeFileExt(FInputFileName, '.tzx');
{ add your program here } { add your program here }
@ -127,7 +129,7 @@ end;
procedure TIHX2TZX.WriteHelp; procedure TIHX2TZX.WriteHelp;
begin begin
{ add your help code here } { add your help code here }
writeln('Usage: ', ExeName, ' -h'); writeln('Usage: ', ExeName, ' [options] ihx_file [tzx_file]');
end; end;
var var