Permalink
Browse files

[enhance] manpages: added manpage generator for opatop

  • Loading branch information...
1 parent 4a76457 commit 9529343c529c715205f3a3067fbbca06293ba335 Mathieu Baudet committed Dec 14, 2011
Showing with 35 additions and 1 deletion.
  1. +20 −0 opatop/gen_opatop_manpage.ml
  2. +15 −1 opatop/opaTopMain.ml
@@ -0,0 +1,20 @@
+(*
+ Copyright © 2011 MLstate
+
+ This file is part of OPA.
+
+ OPA is free software: you can redistribute it and/or modify it under the
+ terms of the GNU Affero General Public License, version 3, as published by
+ the Free Software Foundation.
+
+ OPA is distributed in the hope that it will be useful, but WITHOUT ANY
+ WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+ FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for
+ more details.
+
+ You should have received a copy of the GNU Affero General Public License
+ along with OPA. If not, see <http://www.gnu.org/licenses/>.
+*)
+
+let _ =
+ OpaTopMain.write_manpage stdout
View
@@ -268,7 +268,7 @@ let main () =
if MutableList.length user_files = 0 || !do_input then (
OManager.oformatter := Format.std_formatter;
OManager.this_is_tool ~force:true "opatop";
- OManager.printf "This is an experimental top-level for opa, type '#help;;' to know more.@\n";
+ OManager.printf "This is an experimental interpretation loop for opa. Type '#help;;' to know more.@\n";
OManager.oformatter := Format.err_formatter;
P.dump_set true;
let env = OpaTopEnv.set_filename env "stdin" in
@@ -277,3 +277,17 @@ let main () =
) else (
()
)
+
+(** Output a manpage file *)
+let write_manpage file =
+ ServerArg.write_simple_manpage
+ ~cmdname:"opatop"
+ ~summary:"The Opa top-level"
+ ~section:1
+ ~centerheader:"Opa Manual"
+ ~synopsis:"opatop [options]"
+ ~description:"Opatop is an experimental interpretation loop for opa. Type '#help;;' to know more."
+ ~options:spec
+ ~other:["NOTE","Opatop also accept some options inherited from the Opa platform. Run 'opatop --help' for details."]
+ file
+

0 comments on commit 9529343

Please sign in to comment.