[gjs] gjs-console: pass through unknown options to the script



commit 95894f478e4d1c1f8704fcc5ff0d80d9099fd720
Author: Havoc Pennington <hp pobox com>
Date:   Sun Apr 19 12:27:16 2009 -0400

    gjs-console: pass through unknown options to the script
    
    Allows scripts to have command line options.
---
 gjs/console.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/gjs/console.c b/gjs/console.c
index d80d2e1..2b21c4f 100644
--- a/gjs/console.c
+++ b/gjs/console.c
@@ -48,6 +48,10 @@ main(int argc, char **argv)
     int code;
 
     context = g_option_context_new(NULL);
+
+    /* pass unknown through to the JS script */
+    g_option_context_set_ignore_unknown_options(context, TRUE);
+
     g_option_context_add_main_entries(context, entries, GETTEXT_PACKAGE);
     if (!g_option_context_parse(context, &argc, &argv, &error))
         g_error("option parsing failed: %s", error->message);



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]