[nautilus-sendto] Add --version argument.



commit 43ddc19820fdcab1f30b67580d9b2cd491577753
Author: Patricia Santana Cruz <patriciasantanacruz gmail com>
Date:   Fri Dec 30 17:28:30 2011 +0000

    Add --version argument.
    
    Fixes https://bugzilla.gnome.org/show_bug.cgi?id=667030.

 src/nautilus-sendto-command.c |    7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)
---
diff --git a/src/nautilus-sendto-command.c b/src/nautilus-sendto-command.c
index 50b650c..241dce9 100644
--- a/src/nautilus-sendto-command.c
+++ b/src/nautilus-sendto-command.c
@@ -53,6 +53,7 @@ enum {
 static char **filenames = NULL;
 static gboolean run_from_build_dir = FALSE;
 static gint64 xid = 0;
+static gboolean show_version = FALSE;
 
 static PeasEngine *engine;
 static PeasExtensionSet *exten_set;
@@ -79,6 +80,7 @@ static const GOptionEntry entries[] = {
 	{ "run-from-build-dir", 'b', 0, G_OPTION_ARG_NONE, &run_from_build_dir, N_("Run from build directory"), NULL },
 	{ "xid", 'x', 0, G_OPTION_ARG_INT64, &xid, N_("Use XID as parent to the send dialogue"), NULL },
 	{ G_OPTION_REMAINING, '\0', 0, G_OPTION_ARG_FILENAME_ARRAY, &filenames, N_("Files to send"), "[FILES...]" },
+	{"version", 'v', 0, G_OPTION_ARG_NONE, &show_version, N_("Output version information and exit"), NULL},
 	{ NULL }
 };
 
@@ -694,6 +696,11 @@ int main (int argc, char **argv)
 		return 1;
 	}
 
+        if (show_version) {
+		g_print ("%s %s\n", PACKAGE_NAME, PACKAGE_VERSION);
+		return 0;
+	}
+
 	nst = g_new0 (NautilusSendto, 1);
 	nst->settings = g_settings_new ("org.gnome.Nautilus.Sendto");
 	nautilus_sendto_init (nst);



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