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 = {
22 { "target", 0, 0, OptionArg.STRING, ref opt_target, "Target File to write (eg. roojs.js)", null },
23 { "debug-target", 0, 0, OptionArg.STRING, ref opt_debug_target, "Target File to write debug code (eg. roojs-debug.js)", null },
24 { "tmpdir", 0, 0, OptionArg.STRING, ref opt_tmpdir, "Temporary Directory to use", null },
25 { "file", 0, 0, OptionArg.STRING_ARRAY, ref opt_files ,"add a file to compile", null },
26 { "files-from", 0, 0, OptionArg.STRING, ref opt_files_from ,"a text file listing files to compile", null },
28 { "debug", 0, 0, OptionArg.NONE, ref opt_debug, "Show debug messages", null },
31 public static string opt_target = "";
32 public static string opt_target = "";
33 public static string opt_tmpdir = "";
36 public static string[] opt_files = {};
37 public static string opt_files_from = "";
38 public static bool opt_debug = false;
43 public PackerRun (string[] args)
47 application_id: "org.roojs.jsdoc.packerrun",
48 flags: ApplicationFlags.FLAGS_NONE
52 var opt_context = new OptionContext ("JSDOC Packer");
55 opt_context.set_help_enabled (true);
56 opt_context.add_main_entries (options, null);
57 opt_context.parse (ref args);
60 } catch (OptionError e) {
61 stdout.printf ("error: %s\n", e.message);
62 stdout.printf ("Run '%s --help' to see a full list of available command line options.\n %s",
63 args[0], opt_context.get_help(true,null));
64 GLib.Process.exit(Posix.EXIT_FAILURE);
70 // now run the Packer...
71 var p = new Packer(opt_target, opt_debugTarget);