anchor.diff:        lPFile := ExtractFileNameOnly(FPasFiles[j]);
         if SameText(lXFile, lPFile) then
         begin
  -        FCommand := FCommand + ' \' + LineEnding + Format(cFileLine, [Format(cFilePath, [FPasFiles[j]]), FXMLFiles[i]]);
  +      // fix command line separators at the same time
  +        FCommand := FCommand + FDivider + Format(cFileLine, [SetDirSeparators(Format(cFilePath, [FPasFiles[j]])), FXMLFiles[i]]);
         end;
       end;
     end;
   
  +//  FCommand := SetDirSeparators(FCommand);
  +  {.$IFDEF Windows}
  +  FCommand := StringReplace(FCommand, '''', '"', [rfReplaceAll]);
  +  {.$ENDIF}
  +end;
  +
  +procedure TBuildDocsApp.WriteScript;
  +begin
     FXMLFiles.Text := FCommand;
  +  {$IFDEF Windows}
  +  FXMLFiles.SaveToFile('runme2.bat');
  +  {$else}
     FXMLFiles.SaveToFile('runme2.sh');
  -end;
  -
  +  {$endif}
  +end;
  +
  +procedure TBuildDocsApp.ExecuteFPDoc;
  +var
  +  p: TProcess;
  +begin
  +  p := TProcess.Create(nil);
  +  try
  +//    writeln('------------ START -------------------');
  +//    writeln(FCommand);
  +//    writeln('------------ END -------------------');
  +    p.CommandLine := FCommand;
  +    p.Options := [poWaitOnExit];
  +    p.Execute;
  +  finally
  +    p.Free;
  +  end;
  +end;
   procedure TBuildDocsApp.DoRun;
   var
     ErrorMsg: String;
   begin
     // quick check parameters
  -  ErrorMsg:=CheckOptions('h','help');
  +  ErrorMsg:=CheckOptions('hs','help');
     if ErrorMsg<>'' then begin
       ShowException(Exception.Create(ErrorMsg));
       Terminate;
  
positive.code:     FXMLFiles: TStrings;
      FPasFiles: TStrings;
      FCommand: string;
      procedure   FileSearch(SearchDir: string; ExtensionMask: string; var FileList: TStrings; Recursive: boolean = True);
      function    ExtractFileNameOnly(AFilename: string): string;
      procedure   BuildScript;
    protected
      procedure   DoRun; override;
    public
  
negative.code:   end;
  
    // parse parameters
    if HasOption('h','help') then
    begin
      WriteHelp;
      Terminate;
      Exit;
    end;
  
    if HasOption('s','script') then
      FDivider := {$ifdef unix}' \' + LineEnding {$else} '' {$endif}
    else
      FDivider := '';
  
    BuildCommandLine;
  
    if HasOption('s','script') then
      WriteScript
    else
      ExecuteFPDoc;
  
    // stop program loop
    Terminate;
  