gvfs r1576 - in trunk: . programs



Author: alexl
Date: Thu Mar  6 11:15:59 2008
New Revision: 1576
URL: http://svn.gnome.org/viewvc/gvfs?rev=1576&view=rev

Log:
2008-03-05  A. Walton  <awalton svn gnome org>

	* programs/gvfs-cat.c (main):
	* programs/gvfs-copy.c (main):
	* programs/gvfs-info.c (main):
	* programs/gvfs-ls.c (main):
	* programs/gvfs-move.c (main):
	* programs/gvfs-open.c (main):
	* programs/gvfs-save.c (main):
	* programs/gvfs-tree.c (main):
	Error out if the user passes invalid flags and warn the user.
	Fixes bug #520086.



Modified:
   trunk/ChangeLog
   trunk/programs/gvfs-cat.c
   trunk/programs/gvfs-copy.c
   trunk/programs/gvfs-info.c
   trunk/programs/gvfs-ls.c
   trunk/programs/gvfs-move.c
   trunk/programs/gvfs-open.c
   trunk/programs/gvfs-save.c
   trunk/programs/gvfs-tree.c

Modified: trunk/programs/gvfs-cat.c
==============================================================================
--- trunk/programs/gvfs-cat.c	(original)
+++ trunk/programs/gvfs-cat.c	Thu Mar  6 11:15:59 2008
@@ -157,6 +157,17 @@
 
   g_option_context_free (context);
   g_free (summary);
+  
+  if (error != NULL)
+    {
+      g_printerr ("Error parsing commandline options: %s\n", error->message);
+      g_printerr ("\n");
+      g_printerr (_("Try \"%s --help\" for more information."),
+                  g_get_prgname ());
+      g_printerr ("\n");
+      g_error_free(error);
+      return 1;
+    }
 
   if (!locations)
     {

Modified: trunk/programs/gvfs-copy.c
==============================================================================
--- trunk/programs/gvfs-copy.c	(original)
+++ trunk/programs/gvfs-copy.c	Thu Mar  6 11:15:59 2008
@@ -29,6 +29,7 @@
 #include <string.h>
 
 #include <glib.h>
+#include <glib/gi18n.h>
 #include <gio/gio.h>
 
 static gboolean progress = FALSE;
@@ -92,6 +93,17 @@
   g_option_context_add_main_entries (context, entries, GETTEXT_PACKAGE);
   g_option_context_parse (context, &argc, &argv, &error);
   g_option_context_free (context);
+  
+  if (error != NULL)
+    {
+      g_printerr ("Error parsing commandline options: %s\n", error->message);
+      g_printerr ("\n");
+      g_printerr (_("Try \"%s --help\" for more information."),
+                  g_get_prgname ());
+      g_printerr ("\n");
+      g_error_free(error);
+      return 1;
+    }
 
   if (argc <= 2)
     {

Modified: trunk/programs/gvfs-info.c
==============================================================================
--- trunk/programs/gvfs-info.c	(original)
+++ trunk/programs/gvfs-info.c	Thu Mar  6 11:15:59 2008
@@ -24,6 +24,7 @@
 
 #include <glib.h>
 #include <locale.h>
+#include <glib/gi18n.h>
 #include <gio/gio.h>
 
 static char *attributes = NULL;
@@ -328,6 +329,17 @@
   g_option_context_add_main_entries (context, entries, GETTEXT_PACKAGE);
   g_option_context_parse (context, &argc, &argv, &error);
   g_option_context_free (context);
+  
+  if (error != NULL)
+    {
+      g_printerr ("Error parsing commandline options: %s\n", error->message);
+      g_printerr ("\n");
+      g_printerr (_("Try \"%s --help\" for more information."),
+                  g_get_prgname ());
+      g_printerr ("\n");
+      g_error_free(error);
+      return 1;
+    }
  
   if (argc > 1)
     {

Modified: trunk/programs/gvfs-ls.c
==============================================================================
--- trunk/programs/gvfs-ls.c	(original)
+++ trunk/programs/gvfs-ls.c	Thu Mar  6 11:15:59 2008
@@ -27,6 +27,7 @@
 #include <glib.h>
 #include <locale.h>
 #include <string.h>
+#include <glib/gi18n.h>
 #include <gio/gio.h>
 
 static char *attributes = NULL;
@@ -379,6 +380,17 @@
   g_option_context_add_main_entries (context, entries, GETTEXT_PACKAGE);
   g_option_context_parse (context, &argc, &argv, &error);
   g_option_context_free (context);
+  
+  if (error != NULL)
+    {
+      g_printerr ("Error parsing commandline options: %s\n", error->message);
+      g_printerr ("\n");
+      g_printerr (_("Try \"%s --help\" for more information."),
+                  g_get_prgname ());
+      g_printerr ("\n");
+      g_error_free(error);
+      return 1;
+    }
 
   if (attributes != NULL)
     {

Modified: trunk/programs/gvfs-move.c
==============================================================================
--- trunk/programs/gvfs-move.c	(original)
+++ trunk/programs/gvfs-move.c	Thu Mar  6 11:15:59 2008
@@ -29,6 +29,7 @@
 #include <string.h>
 
 #include <glib.h>
+#include <glib/gi18n.h>
 #include <gio/gio.h>
 
 static gboolean progress = FALSE;
@@ -88,6 +89,17 @@
   g_option_context_add_main_entries (context, entries, GETTEXT_PACKAGE);
   g_option_context_parse (context, &argc, &argv, &error);
   g_option_context_free (context);
+  
+  if (error != NULL)
+    {
+      g_printerr ("Error parsing commandline options: %s\n", error->message);
+      g_printerr ("\n");
+      g_printerr (_("Try \"%s --help\" for more information."),
+                  g_get_prgname ());
+      g_printerr ("\n");
+      g_error_free(error);
+      return 1;
+    }
 
   if (argc <= 2)
     {

Modified: trunk/programs/gvfs-open.c
==============================================================================
--- trunk/programs/gvfs-open.c	(original)
+++ trunk/programs/gvfs-open.c	Thu Mar  6 11:15:59 2008
@@ -125,6 +125,17 @@
   g_option_context_parse (context, &argc, &argv, &error);
 
   g_option_context_free (context);
+  
+  if (error != NULL)
+    {
+      g_printerr ("Error parsing commandline options: %s\n", error->message);
+      g_printerr ("\n");
+      g_printerr (_("Try \"%s --help\" for more information."),
+                  g_get_prgname ());
+      g_printerr ("\n");
+      g_error_free(error);
+      return 1;
+    }
 
   if (!locations)
     {

Modified: trunk/programs/gvfs-save.c
==============================================================================
--- trunk/programs/gvfs-save.c	(original)
+++ trunk/programs/gvfs-save.c	Thu Mar  6 11:15:59 2008
@@ -28,6 +28,7 @@
 #include <errno.h>
 
 #include <glib.h>
+#include <glib/gi18n.h>
 #include <gio/gio.h>
 
 static char *etag = NULL;
@@ -156,6 +157,17 @@
   g_option_context_add_main_entries (context, entries, GETTEXT_PACKAGE);
   g_option_context_parse (context, &argc, &argv, &error);
   g_option_context_free (context);
+  
+  if (error != NULL)
+    {
+      g_printerr ("Error parsing commandline options: %s\n", error->message);
+      g_printerr ("\n");
+      g_printerr (_("Try \"%s --help\" for more information."),
+                  g_get_prgname ());
+      g_printerr ("\n");
+      g_error_free(error);
+      return 1;
+    }
 
   res = FALSE;
   

Modified: trunk/programs/gvfs-tree.c
==============================================================================
--- trunk/programs/gvfs-tree.c	(original)
+++ trunk/programs/gvfs-tree.c	Thu Mar  6 11:15:59 2008
@@ -27,6 +27,7 @@
 #include <glib.h>
 #include <locale.h>
 #include <string.h>
+#include <glib/gi18n.h>
 #include <gio/gio.h>
 
 static gboolean show_hidden = FALSE;
@@ -244,6 +245,17 @@
   g_option_context_add_main_entries (context, entries, GETTEXT_PACKAGE);
   g_option_context_parse (context, &argc, &argv, &error);
   g_option_context_free (context);
+  
+  if (error != NULL)
+    {
+      g_printerr ("Error parsing commandline options: %s\n", error->message);
+      g_printerr ("\n");
+      g_printerr (_("Try \"%s --help\" for more information."),
+                  g_get_prgname ());
+      g_printerr ("\n");
+      g_error_free(error);
+      return 1;
+    }
 
   if (argc > 1)
     {



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