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.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_tmpdir = "";
35 public static string[] opt_files = {};
36 public static string opt_files_from = "";
37 public static bool opt_debug = false;
42 public PackerRun (string[] args)
46 application_id: "org.roojs.jsdoc.packerrun",
47 flags: ApplicationFlags.FLAGS_NONE
51 var opt_context = new OptionContext ("JSDOC Packer");
54 opt_context.set_help_enabled (true);
55 opt_context.add_main_entries (options, null);
56 opt_context.parse (ref args);
59 } catch (OptionError e) {
60 stdout.printf ("error: %s\n", e.message);
61 stdout.printf ("Run '%s --help' to see a full list of available command line options.\n %s",
62 args[0], opt_context.get_help(true,null));
63 GLib.Process.exit(Posix.EXIT_FAILURE);
69 // now run the Packer...
70 var p = new Packer(opt_target, opt_debugTarget);