[caribou] Add --help option to caribou command



commit 418d68d8db120b17e5fc4a5c8b6452afbcff8120
Author: Daiki Ueno <ueno unixuser org>
Date:   Fri Mar 15 16:32:25 2013 +0900

    Add --help option to caribou command

 daemon/daemon.vala |   14 ++++++++++++++
 1 files changed, 14 insertions(+), 0 deletions(-)
---
diff --git a/daemon/daemon.vala b/daemon/daemon.vala
index 70d5fdd..a7e09c2 100644
--- a/daemon/daemon.vala
+++ b/daemon/daemon.vala
@@ -175,6 +175,10 @@ namespace Caribou {
     }
 }
 
+static const OptionEntry[] options = {
+    { null }
+};
+
 static int main (string[] args) {
     Gtk.init (ref args);
 
@@ -183,6 +187,16 @@ static int main (string[] args) {
     Intl.bind_textdomain_codeset (Config.GETTEXT_PACKAGE, "UTF-8");
     Intl.textdomain (Config.GETTEXT_PACKAGE);
 
+    var option_context = new OptionContext (
+        "- daemon listening accessibility events to launch on screen keyboard");
+    option_context.add_main_entries (options, "caribou");
+    try {
+        option_context.parse (ref args);
+    } catch (OptionError e) {
+        stderr.printf ("%s\n", e.message);
+        return 1;
+    }
+
     var retval = Atspi.init ();
     if (retval != 0) {
         printerr ("can't initialize atspi\n");


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