gedit r6669 - in trunk: . gedit



Author: pborelli
Date: Sat Dec 20 15:33:34 2008
New Revision: 6669
URL: http://svn.gnome.org/viewvc/gedit?rev=6669&view=rev

Log:
2008-12-20  Paolo Borelli  <pborelli katamail com>

	* gedit/gedit.c: add a command line switch to show the version



Modified:
   trunk/ChangeLog
   trunk/gedit/gedit.c

Modified: trunk/gedit/gedit.c
==============================================================================
--- trunk/gedit/gedit.c	(original)
+++ trunk/gedit/gedit.c	Sat Dec 20 15:33:34 2008
@@ -63,6 +63,14 @@
 static guint32 startup_timestamp = 0;
 static BaconMessageConnection *connection;
 
+static void
+show_version_and_quit (void)
+{
+	g_print ("%s - Version %s\n", g_get_application_name (), VERSION);
+
+	exit (0);
+}
+
 /* command line */
 static gint line_position = 0;
 static gchar *encoding_charset = NULL;
@@ -74,6 +82,9 @@
 
 static const GOptionEntry options [] =
 {
+	{ "version", 'V', G_OPTION_FLAG_NO_ARG, G_OPTION_ARG_CALLBACK,
+	  show_version_and_quit, N_("Show the application's version"), NULL },
+
 	{ "encoding", '\0', 0, G_OPTION_ARG_STRING, &encoding_charset,
 	  N_("Set the character encoding to be used to open the files listed on the command line"), N_("ENCODING")},
 



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