Skip to content

Commit

Permalink
[enhance] manpages: added manpage generator for opatop
Browse files Browse the repository at this point in the history
  • Loading branch information
Mathieu Baudet committed Dec 20, 2011
1 parent 4a76457 commit 9529343
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 1 deletion.
20 changes: 20 additions & 0 deletions opatop/gen_opatop_manpage.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
16 changes: 15 additions & 1 deletion opatop/opaTopMain.ml
Expand Up @@ -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
Expand All @@ -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.