[gnome-utils] [gsearchtool] Resurrect the --version command line argument
- From: Dennis Cranston <dcransto src gnome org>
- To: svn-commits-list gnome org
- Cc:
- Subject: [gnome-utils] [gsearchtool] Resurrect the --version command line argument
- Date: Thu, 15 Oct 2009 04:51:19 +0000 (UTC)
commit b592e8609296caa7a7902e547c1cce94001d6081
Author: Dennis Cranston <dennis_cranston yahoo com>
Date: Wed Oct 14 14:49:44 2009 -0700
[gsearchtool] Resurrect the --version command line argument
gsearchtool/ChangeLog | 9 +++++++--
gsearchtool/gsearchtool-callbacks.c | 11 +++++++++++
gsearchtool/gsearchtool-callbacks.h | 5 +++++
gsearchtool/gsearchtool.c | 3 ++-
4 files changed, 25 insertions(+), 3 deletions(-)
---
diff --git a/gsearchtool/ChangeLog b/gsearchtool/ChangeLog
index af456dc..b7d074d 100644
--- a/gsearchtool/ChangeLog
+++ b/gsearchtool/ChangeLog
@@ -1,11 +1,16 @@
+2009-10-14 Dennis Cranston <dennis_cranston yahoo com>
+
+ * gsearchtool.c, gsearchtool-callbacks.[ch]: Resurrect the
+ "--version" command line argument.
+
2009-09-29 Dennis Cranston <dennis_cranston yahoo com>
- * gsearchtool.c: Properly handle invalid command line
+ * gsearchtool.c: Properly handle invalid command line
arguments.
2009-09-28 Dennis Cranston <dennis_cranston yahoo com>
- * gsearchtool-callbacks.c: Fix possible crash after
+ * gsearchtool-callbacks.c: Fix possible crash after
delete files. Patch submitted by Sebastien Bacher.
Bug 595371.
diff --git a/gsearchtool/gsearchtool-callbacks.c b/gsearchtool/gsearchtool-callbacks.c
index 1496b8d..4e409c9 100644
--- a/gsearchtool/gsearchtool-callbacks.c
+++ b/gsearchtool/gsearchtool-callbacks.c
@@ -31,6 +31,7 @@
#include <string.h>
#include <signal.h>
+#include <stdlib.h>
#include <sys/wait.h>
#include <sys/types.h>
#include <unistd.h>
@@ -94,6 +95,16 @@ quit_application (GSearchWindow * gsearch)
}
void
+version_cb (const gchar * option_name,
+ const gchar * value,
+ gpointer data,
+ GError ** error)
+{
+ g_print ("%s %s\n", g_get_application_name (), VERSION);
+ exit (0);
+}
+
+void
quit_session_cb (EggSMClient * client,
gpointer data)
{
diff --git a/gsearchtool/gsearchtool-callbacks.h b/gsearchtool/gsearchtool-callbacks.h
index 604eed6..191cc94 100644
--- a/gsearchtool/gsearchtool-callbacks.h
+++ b/gsearchtool/gsearchtool-callbacks.h
@@ -36,6 +36,11 @@ extern "C" {
#include "eggsmclient.h"
void
+version_cb (const gchar * option_name,
+ const gchar * value,
+ gpointer data,
+ GError ** error);
+void
quit_session_cb (EggSMClient * client,
gpointer data);
void
diff --git a/gsearchtool/gsearchtool.c b/gsearchtool/gsearchtool.c
index 1d02d21..00a9853 100644
--- a/gsearchtool/gsearchtool.c
+++ b/gsearchtool/gsearchtool.c
@@ -154,6 +154,7 @@ struct _GSearchGOptionArguments {
} GSearchGOptionArguments;
static GOptionEntry GSearchGOptionEntries[] = {
+ { "version", 0, G_OPTION_FLAG_NO_ARG, G_OPTION_ARG_CALLBACK, version_cb, N_("Show version of the application"), NULL},
{ "named", 0, 0, G_OPTION_ARG_STRING, &GSearchGOptionArguments.name, NULL, N_("STRING") },
{ "path", 0, 0, G_OPTION_ARG_STRING, &GSearchGOptionArguments.path, NULL, N_("PATH") },
{ "sortby", 0, 0, G_OPTION_ARG_STRING, &GSearchGOptionArguments.sortby, NULL, N_("VALUE") },
@@ -1281,7 +1282,7 @@ add_atk_relation (GtkWidget * obj1,
static void
gsearch_setup_goption_descriptions (void)
{
- gint i = 0;
+ gint i = 1;
gint j;
GSearchGOptionEntries[i++].description = g_strdup (_("Set the text of \"Name contains\" search option"));
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]