4 -- in theory this code can be used as a library... but this is the standard command line version...
9 // --------------- <<<<<<< <MAIN HERE....
10 public static int main(string[] args)
17 class PackerRun : Application
19 const OptionEntry[] options = {
21 { "jsfile", 'f', 0, OptionArg.FILENAME_ARRAY, ref opt_files ,"add a file to compile", null },
22 { "target", 't', 0, OptionArg.STRING, ref opt_target, "Target File to write (eg. roojs.js)", null },
23 { "debug-target", 'T', 0, OptionArg.STRING, ref opt_debug_target, "Target File to write debug code (eg. roojs-debug.js)", null },
24 { "tmpdir", 'm', 0, OptionArg.STRING, ref opt_tmpdir, "Temporary Directory to use", null },
26 { "index-files", 'i', 0, OptionArg.FILENAME_ARRAY, ref opt_files_from ,"files that contain listing of files to compile", null },
28 { "debug", 0, 0, OptionArg.NONE, ref opt_debug, "Show debug messages", null },
29 // fixme -- keepwhite.. cleanup
33 public static string opt_target = "";
34 public static string opt_debug_target = "";
35 public static string opt_tmpdir = "";
38 private static string[]? opt_files = null;
39 private static string[]? opt_files_from = null;
40 public static bool opt_debug = false;
45 public PackerRun (string[] args)
49 application_id: "org.roojs.jsdoc.packerrun",
50 flags: ApplicationFlags.FLAGS_NONE
54 var opt_context = new OptionContext ("JSDOC Packer");
57 opt_context.set_help_enabled (true);
58 opt_context.add_main_entries (options, null);
59 opt_context.parse (ref args);
62 } catch (OptionError e) {
63 stdout.printf ("error: %s\n", e.message);
64 stdout.printf ("Run '%s --help' to see a full list of available command line options.\n %s",
65 args[0], opt_context.get_help(true,null));
66 GLib.Process.exit(Posix.EXIT_FAILURE);
71 GLib.Log.set_handler(null,
72 GLib.LogLevelFlags.LEVEL_DEBUG | GLib.LogLevelFlags.LEVEL_WARNING,
74 print("%s: %s\n", dom, msg);
78 // now run the Packer...
79 var p = new Packer(opt_target, opt_debug_target);
80 if (opt_files != null) {
81 for (string f in opt_files) {
82 GLib.debug("Adding File %s", f);
86 GLib.debug("No files added");