diff options
-rw-r--r-- | gio/gio-tool-mount.c | 10 | ||||
-rw-r--r-- | gio/gio-tool-trash.c | 13 |
2 files changed, 17 insertions, 6 deletions
diff --git a/gio/gio-tool-mount.c b/gio/gio-tool-mount.c index fab32694c..2797d94b6 100644 --- a/gio/gio-tool-mount.c +++ b/gio/gio-tool-mount.c @@ -1160,8 +1160,6 @@ handle_mount (int argc, char *argv[], gboolean do_help) return 1; } - g_option_context_free (context); - main_loop = g_main_loop_new (NULL, FALSE); if (mount_list) @@ -1186,6 +1184,14 @@ handle_mount (int argc, char *argv[], gboolean do_help) g_object_unref (file); } } + else + { + show_help (context, _("No locations given")); + g_option_context_free (context); + return 1; + } + + g_option_context_free (context); if (outstanding_mounts > 0) g_main_loop_run (main_loop); diff --git a/gio/gio-tool-trash.c b/gio/gio-tool-trash.c index aa4d8c3b3..7d00a5d14 100644 --- a/gio/gio-tool-trash.c +++ b/gio/gio-tool-trash.c @@ -101,8 +101,6 @@ handle_trash (int argc, char *argv[], gboolean do_help) return 1; } - g_option_context_free (context); - if (argc > 1) { int i; @@ -124,14 +122,21 @@ handle_trash (int argc, char *argv[], gboolean do_help) g_object_unref (file); } } - - if (empty) + else if (empty) { GFile *file; file = g_file_new_for_uri ("trash:"); delete_trash_file (file, FALSE, TRUE); g_object_unref (file); } + else + { + show_help (context, _("No locations given")); + g_option_context_free (context); + return 1; + } + + g_option_context_free (context); return retval; } |