|
@@ -35,8 +35,9 @@ type
|
|
{ TJunkObject }
|
|
{ TJunkObject }
|
|
|
|
|
|
TJunkObject = class
|
|
TJunkObject = class
|
|
- Section : Integer;
|
|
|
|
- count : integer;
|
|
|
|
|
|
+ Section : Integer;
|
|
|
|
+ count : integer;
|
|
|
|
+ donotpage: boolean;
|
|
procedure OnFileEntry(Name: String; Offset, UncompressedSize, ASection: Integer);
|
|
procedure OnFileEntry(Name: String; Offset, UncompressedSize, ASection: Integer);
|
|
end;
|
|
end;
|
|
|
|
|
|
@@ -56,6 +57,7 @@ begin
|
|
writeln(stderr);
|
|
writeln(stderr);
|
|
writeln(stderr,'Switches : ');
|
|
writeln(stderr,'Switches : ');
|
|
writeln(stderr,' -h, --help : this screen');
|
|
writeln(stderr,' -h, --help : this screen');
|
|
|
|
+ writeln(stderr,' -n : do not page list output');
|
|
writeln(stderr);
|
|
writeln(stderr);
|
|
writeln(stderr,'Where command is one of the following or if omitted, equal to LIST.');
|
|
writeln(stderr,'Where command is one of the following or if omitted, equal to LIST.');
|
|
writeln(stderr,' list <filename> [section number] ');
|
|
writeln(stderr,' list <filename> [section number] ');
|
|
@@ -103,7 +105,7 @@ procedure TJunkObject.OnFileEntry(Name: String; Offset, UncompressedSize,
|
|
begin
|
|
begin
|
|
Inc(Count);
|
|
Inc(Count);
|
|
if (Section > -1) and (ASection <> Section) then Exit;
|
|
if (Section > -1) and (ASection <> Section) then Exit;
|
|
- if (Count = 1) or (Count mod 40 = 0) then
|
|
|
|
|
|
+ if (Count = 1) or ((Count mod 40 = 0) and not donotpage) then
|
|
WriteLn(StdErr, '<Section> <Offset> <UnCompSize> <Name>');
|
|
WriteLn(StdErr, '<Section> <Offset> <UnCompSize> <Name>');
|
|
Write(' ');
|
|
Write(' ');
|
|
Write(ASection);
|
|
Write(ASection);
|
|
@@ -115,6 +117,8 @@ begin
|
|
WriteLn(Name);
|
|
WriteLn(Name);
|
|
end;
|
|
end;
|
|
|
|
|
|
|
|
+var donotpage:boolean=false;
|
|
|
|
+
|
|
procedure ListChm(Const Name:string;Section:Integer);
|
|
procedure ListChm(Const Name:string;Section:Integer);
|
|
var
|
|
var
|
|
ITS: TITSFReader;
|
|
ITS: TITSFReader;
|
|
@@ -132,6 +136,7 @@ begin
|
|
JunkObject := TJunkObject.Create;
|
|
JunkObject := TJunkObject.Create;
|
|
JunkObject.Section:=Section;
|
|
JunkObject.Section:=Section;
|
|
JunkObject.Count:=0;
|
|
JunkObject.Count:=0;
|
|
|
|
+ JunkObject.DoNotPage:=DoNotPage;
|
|
|
|
|
|
ITS:= TITSFReader.Create(Stream, True);
|
|
ITS:= TITSFReader.Create(Stream, True);
|
|
ITS.GetCompleteFileList(@JunkObject.OnFileEntry);
|
|
ITS.GetCompleteFileList(@JunkObject.OnFileEntry);
|
|
@@ -217,7 +222,7 @@ begin
|
|
Writeln(stderr,'chmls, a CHM utility. (c) 2010 Free Pascal core.');
|
|
Writeln(stderr,'chmls, a CHM utility. (c) 2010 Free Pascal core.');
|
|
Writeln(Stderr);
|
|
Writeln(Stderr);
|
|
repeat
|
|
repeat
|
|
- c:=getlongopts('h',@theopts[1],optionindex);
|
|
|
|
|
|
+ c:=getlongopts('hn',@theopts[1],optionindex);
|
|
case c of
|
|
case c of
|
|
#0 : begin
|
|
#0 : begin
|
|
case optionindex-1 of
|
|
case optionindex-1 of
|
|
@@ -227,6 +232,7 @@ begin
|
|
end;
|
|
end;
|
|
end;
|
|
end;
|
|
end;
|
|
end;
|
|
|
|
+ 'n' : donotpage:=true;
|
|
'?','h' :
|
|
'?','h' :
|
|
begin
|
|
begin
|
|
writeln('unknown option',optopt);
|
|
writeln('unknown option',optopt);
|