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