4 -- in theory this code can be used as a library... but this is the standard command line version...
10 class PackerRun : Gtk.Application
12 const OptionEntry[] options = {
15 { "project", 0, 0, OptionArg.STRING, ref opt_compile_project, "Compile a project", null },
16 { "target", 0, 0, OptionArg.STRING, ref opt_compile_target, "Target to build", null },
17 { "skip-file", 0, 0, OptionArg.STRING, ref opt_compile_skip ,"For test compiles do not add this (usually used in conjunction with add-file ", null },
18 { "add-file", 0, 0, OptionArg.STRING, ref opt_compile_add, "Add this file to compile list", null },
19 { "output", 0, 0, OptionArg.STRING, ref opt_compile_output, "output binary file path", null },
20 { "debug", 0, 0, OptionArg.NONE, ref opt_debug, "Show debug messages", null },
23 public static string opt_compile_project;
24 public static string opt_compile_target;
25 public static string opt_compile_skip;
26 public static string opt_compile_add;
27 public static string opt_compile_output;
28 public static bool opt_debug = false;
30 public static string _self;
32 public PackerRun (string[] args)
35 _self = FileUtils.read_link("/proc/self/exe");
36 GLib.debug("SELF = %s", _self);
39 application_id: "org.roojs.jsdoc.packerrun",
40 flags: ApplicationFlags.FLAGS_NONE
44 var opt_context = new OptionContext ("JSDOC Packer");
47 opt_context.set_help_enabled (true);
48 opt_context.add_main_entries (options, null);
49 opt_context.parse (ref args);
52 } catch (OptionError e) {
53 stdout.printf ("error: %s\n", e.message);
54 stdout.printf ("Run '%s --help' to see a full list of available command line options.\n %s",
55 args[0], opt_context.get_help(true,null));
56 GLib.Process.exit(Posix.EXIT_FAILURE);
60 // now run the Packer...