* Implemented --descr-dir and --input-dir

git-svn-id: trunk@19755 -
This commit is contained in:
michael 2011-12-04 19:36:36 +00:00
parent a19b627739
commit 293f20b26c
2 changed files with 38 additions and 0 deletions

View File

@ -153,6 +153,8 @@ resourcestring
SUsageOption210 = '--write-project=file Do not write documentation, create project file instead';
SUsageOption220 = '--verbose Write more information on the screen';
SUsageOption230 = '--dry-run Only parse sources and XML, do not create output';
SUsageOption240 = '--descr-dir=Dir Add All XML files in Dir to list of description files';
SUsageOption250 = '--input-dir=Dir Add All *.pp and *.pas files in Dir to list of input files';
SUsageFormats = 'The following output formats are supported by this fpdoc:';
SUsageBackendHelp = 'Specify an output format, combined with --help to get more help for this backend.';

View File

@ -88,6 +88,8 @@ begin
Writeln(SUsageOption210);
Writeln(SUsageOption220);
Writeln(SUsageOption230);
Writeln(SUsageOption240);
Writeln(SUsageOption250);
L:=TStringList.Create;
Try
Backend:=FCreator.OPtions.Backend;
@ -197,6 +199,33 @@ end;
procedure TFPDocAplication.Parseoption(Const S : String);
procedure AddDirToFileList(List: TStrings; const ADirName, AMask: String);
Var
Info : TSearchRec;
D : String;
begin
if (ADirName<>'') and not DirectoryExists(ADirName) then
OutputLog(Self,'Directory '+ADirName+' does not exist')
else
begin
if (ADirName='.') or (ADirName='') then
D:=''
else
D:=IncludeTrailingPathDelimiter(ADirName);
If (FindFirst(D+AMask,0,Info)=0) then
try
Repeat
If (Info.Attr and faDirectory)=0 then
List.Add(D+Info.name);
Until FindNext(Info)<>0;
finally
FindClose(Info);
end;
end;
end;
procedure AddToFileList(List: TStrings; const FileName: String);
var
f: Text;
@ -253,6 +282,8 @@ begin
end
else if (Cmd = '--descr') then
AddToFileList(SelectedPackage.Descriptions, Arg)
else if (Cmd = '--descr-dir') then
AddDirToFileList(SelectedPackage.Descriptions, Arg, '*.xml')
else if (Cmd = '-f') or (Cmd = '--format') then
begin
Arg:=UpperCase(Arg);
@ -265,6 +296,11 @@ begin
FCreator.Options.Language := Arg
else if (Cmd = '-i') or (Cmd = '--input') then
AddToFileList(SelectedPackage.Inputs, Arg)
else if (Cmd = '--input-dir') then
begin
AddDirToFileList(SelectedPackage.Inputs, Arg,'*.pp');
AddDirToFileList(SelectedPackage.Inputs, Arg,'*.pas');
end
else if (Cmd = '-o') or (Cmd = '--output') then
SelectedPackage.Output := Arg
else if (Cmd = '-v') or (Cmd = '--verbose') then