2 * Copyright (C) 2011 Red Hat Inc.
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; either version 2 of the License, or
7 * (at your option) any later version.
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software
16 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
21 let eps = Wrappi_globals.get_entry_points ()
23 let dump_and_exit () =
24 printf "entry points:\n";
27 printf " %s\n" (Wrappi_types.string_of_entry_point ep)
32 (* Parse command line arguments. *)
34 let display_version () =
35 printf "%s %s\n" Config.package_name Config.package_version;
39 let argspec = Arg.align [
40 "--dump", Arg.Unit dump_and_exit, " Dump API data and exit.";
41 "--version", Arg.Unit display_version, " Display version number and exit.";
43 let anon_fun str = raise (Arg.Bad "generator: unknown parameter") in
44 let usage_msg = "wrappi generator: generates lots of code
46 To run the generator normally (note it MUST be run from the top
47 level SOURCE directory):
51 Options are for debugging only:
53 ./generator/generator [--options]
56 Arg.parse argspec anon_fun usage_msg
59 printf "generator, %d entry points\n" (List.length eps)