JSDOC/PackerRun.vala
[gnome.introspection-doc-generator] / JSDOC / PackerRun.vala
1
2 /** 
3   the application
4   -- in theory this code  can be used as a library... but this is the standard command line version...
5 */
6
7 namespace JSDOC
8 {
9
10         class PackerRun : Gtk.Application  
11         {
12                 const OptionEntry[] options = {
13                 
14                         
15                         { "target", 0, 0, OptionArg.STRING, ref opt_target "Target File to write (eg. roojs.js)", null },
16                         { "tmpdir", 0, 0, OptionArg.STRING, ref opt_tmpdir, "Temporary Directory to use", null },
17                         { "file", 0, 0, OptionArg.STRING, ref opt_compile_files ,"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 },
21                         { null }
22                 };
23                 public static string opt_compile_project;
24                 public static string opt_compile_target;
25                 public static string[] opt_compile_files;
26
27         
28                 public PackerRun (string[] args)
29                 {
30                 
31                         Object(
32                             application_id: "org.roojs.jsdoc.packerrun",
33                                 flags: ApplicationFlags.FLAGS_NONE
34                         );
35                                          
36                          
37                         var opt_context = new OptionContext ("JSDOC Packer");
38                         
39                         try {
40                                 opt_context.set_help_enabled (true);
41                                 opt_context.add_main_entries (options, null);
42                                 opt_context.parse (ref args);
43                                  
44                                 
45                         } catch (OptionError e) {
46                                 stdout.printf ("error: %s\n", e.message);
47                                 stdout.printf ("Run '%s --help' to see a full list of available command line options.\n %s", 
48                                                          args[0], opt_context.get_help(true,null));
49                                 GLib.Process.exit(Posix.EXIT_FAILURE);
50                                  
51                         }
52                         
53                         // now run the Packer...
54                         
55                         
56                 }       
57                 
58                 
59         }
60         
61 }