chmcmd.lpr 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. { Copyright (C) <2005> <Andrew Haines> chmcmd.pas
  2. This library is free software; you can redistribute it and/or modify it
  3. under the terms of the GNU Library General Public License as published by
  4. the Free Software Foundation; either version 2 of the License, or (at your
  5. option) any later version.
  6. This program is distributed in the hope that it will be useful, but WITHOUT
  7. ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  8. FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License
  9. for more details.
  10. You should have received a copy of the GNU Library General Public License
  11. along with this library; if not, write to the Free Software Foundation,
  12. Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
  13. }
  14. {
  15. See the file COPYING, included in this distribution,
  16. for details about the copyright.
  17. }
  18. program chmcmd;
  19. {$mode objfpc}{$H+}
  20. uses
  21. Classes, chmfilewriter;
  22. var
  23. OutStream: TFileStream;
  24. Project: TChmProject;
  25. begin
  26. if Paramcount = 1 then begin
  27. Project := TChmProject.Create;
  28. Project.LoadFromFile(ParamStr(1));
  29. OutStream := TFileStream.Create(Project.OutputFileName, fmCreate, fmOpenWrite);
  30. Project.WriteChm(OutStream);
  31. OutStream.Free;
  32. Project.Free;
  33. end;
  34. end.