diff --git a/src/nautilus-connect-server-dialog-main.c b/src/nautilus-connect-server-dialog-main.c
index e96e853..1c9c361 100644
--- a/src/nautilus-connect-server-dialog-main.c
+++ b/src/nautilus-connect-server-dialog-main.c
@@ -42,6 +42,7 @@
 #include "nautilus-connect-server-dialog.h"
 
 static int open_dialogs;
+static gboolean open_in_nautilus = TRUE;
 
 static void
 main_dialog_destroyed (GtkWidget *widget,
@@ -90,27 +91,33 @@ static void
 show_uri (const char *uri,
 	  GtkWidget  *widget)
 {
-	GError    *error;
-	GdkAppLaunchContext *launch_context;
-
-	launch_context = gdk_app_launch_context_new ();
-	gdk_app_launch_context_set_screen (launch_context,
-					   gtk_widget_get_screen (widget));
-
-	error = NULL;
-	g_app_info_launch_default_for_uri (uri,
-					   G_APP_LAUNCH_CONTEXT (launch_context),
-					   &error);
+	if (open_in_nautilus) {
+		GError    *error;
+		GdkAppLaunchContext *launch_context;
+
+		launch_context = gdk_app_launch_context_new ();
+		gdk_app_launch_context_set_screen (launch_context,
+						   gtk_widget_get_screen (widget));
+
+		error = NULL;
+		g_app_info_launch_default_for_uri (uri,
+						   G_APP_LAUNCH_CONTEXT (launch_context),
+						   &error);
+
+		g_object_unref (launch_context);
+
+		if (error) {
+			display_error_dialog (error, uri, widget);
+			g_error_free (error);
+			return;
+		}
+	}
 
-	g_object_unref (launch_context);
+	/* Print URI to console for the benefit of any programs that launched us. */
+	g_print ("%s\n", uri);
 
-	if (error) {
-		display_error_dialog (error, uri, widget);
-		g_error_free (error);
-	} else {
-		/* everything is OK, destroy the main dialog and quit */
-		gtk_widget_destroy (widget);
-	}
+	/* everything is OK, destroy the main dialog and quit */
+	gtk_widget_destroy (widget);
 }
 
 static void
@@ -167,6 +174,7 @@ main (int argc, char *argv[])
 	GFile *location;
 	GError *error;
 	const GOptionEntry options[] = {
+		{ "no-open", 0, G_OPTION_FLAG_REVERSE, G_OPTION_ARG_NONE, &open_in_nautilus, N_("Do not open a nautilus window once connected"), NULL },
 		{ G_OPTION_REMAINING, 0, 0, G_OPTION_ARG_STRING_ARRAY, &args, NULL,  N_("[URI]") },
 		{ NULL }
 	};
