namespace JSDOC
{
// --------------- <<<<<<< <MAIN HERE....
- public static int main(string[] args)
- {
- new PackerRun(args);
- return 0;
- }
-
+
class PackerRun : Application
{
public static string opt_debug_target = "";
public static string opt_tmpdir = "";
-
+ [CCode (array_length = false, array_null_terminated = true)]
private static string[]? opt_files = null;
+ [CCode (array_length = false, array_null_terminated = true)]
private static string[]? opt_files_from = null;
public static bool opt_debug = false;
{ null }
};
+ public static int main(string[] args)
+ {
+ foreach(var a in args) {
+ print("ARG: %s\n", a);
+ }
+
+ var opt_context = new OptionContext ("JSDOC Packer");
+
+ try {
+ opt_context.set_help_enabled (true);
+ opt_context.add_main_entries (options, null);
+ if (!opt_context.parse ( ref args)) {
+ print("options parse error");
+ GLib.Process.exit(Posix.EXIT_FAILURE);
+ }
+
+
+
+
+ } catch (OptionError e) {
+ stdout.printf ("error: %s\n", e.message);
+ stdout.printf ("Run '%s --help' to see a full list of available command line options.\n %s",
+ args[0], opt_context.get_help(true,null));
+ GLib.Process.exit(Posix.EXIT_FAILURE);
+
+ }
+ new PackerRun(args);
+ return 0;
+ }
+
public PackerRun (string[] args)
Object(
application_id: "org.roojs.jsdoc.packerrun",
- flags: ApplicationFlags.FLAGS_NONE
+ flags: ApplicationFlags.HANDLES_COMMAND_LINE
);
- var opt_context = new OptionContext ("JSDOC Packer");
- try {
- opt_context.set_help_enabled (true);
- opt_context.add_main_entries (options, null);
- if (!opt_context.parse (ref args)) {
- print("options parse error");
- GLib.Process.exit(Posix.EXIT_FAILURE);
- }
-
-
-
-
- } catch (OptionError e) {
- stdout.printf ("error: %s\n", e.message);
- stdout.printf ("Run '%s --help' to see a full list of available command line options.\n %s",
- args[0], opt_context.get_help(true,null));
- GLib.Process.exit(Posix.EXIT_FAILURE);
-
- }
// what's required...
if (opt_debug) {
GLib.Log.set_handler(null,
// now run the Packer...
var p = new Packer(opt_target, opt_debug_target);
if (opt_files != null) {
- GLib.debug("Adding File %s", string.join(", ",opt_files));
+
foreach (string f in opt_files) {
GLib.debug("Adding File %s", f);
p.loadFile(f);