Index: gnome-panel-screenshot.c
===================================================================
RCS file: /cvs/gnome/gnome-panel/gnome-panel/gnome-panel-screenshot.c,v
retrieving revision 1.68
diff -u -r1.68 gnome-panel-screenshot.c
--- gnome-panel-screenshot.c	12 Feb 2004 09:39:58 -0000	1.68
+++ gnome-panel-screenshot.c	22 Mar 2004 19:40:40 -0000
@@ -1123,6 +1123,7 @@
 	gdk_flush ();
 }
 
+
 /* main */
 int
 main (int argc, char *argv[])
@@ -1133,6 +1134,7 @@
 	GnomeClient *client;
 	struct stat s;
 	gchar *file;
+	gchar *file_from_command_line=NULL;
 	gboolean window = FALSE;
 	gint width, height; 
 	guint delay = 0;
@@ -1141,11 +1143,13 @@
 	struct poptOption opts[] = {
 		{"window", '\0', POPT_ARG_NONE, NULL, 0, N_("Grab a window instead of the entire screen"), NULL},
 		{"delay", '\0', POPT_ARG_INT, NULL, 0, N_("Take screenshot after specified delay [in seconds]"), NULL},
+		{"file", '\0', POPT_ARG_STRING, NULL, 0, N_("Save screenshot in the given file"), NULL},
 		{NULL, '\0', 0, NULL, 0, NULL, NULL}
 	};
 
 	opts[0].arg = &window;
 	opts[1].arg = &delay;
+	opts[2].arg = &file_from_command_line;
 
 	setlocale (LC_ALL, "");
 	bindtextdomain (GETTEXT_PACKAGE, GNOMELOCALEDIR);
@@ -1169,8 +1173,7 @@
 	if (!get_lock ()) {
 		g_printerr ("gnome-panel-screenshot is already running\n");
 		exit (1);
-	}
-	
+	}	
 	if (window) {
 		if ( ! take_window_shot ()) {
 			release_lock ();
@@ -1179,7 +1182,7 @@
 	} else {
 		take_screen_shot ();
 	}
-
+	
 	if (g_file_test ("gnome-panel-screenshot.glade", G_FILE_TEST_EXISTS)) {
 		xml = glade_xml_new ("gnome-panel-screenshot.glade", NULL, NULL);
 	}
@@ -1292,8 +1295,19 @@
 			  G_CALLBACK (on_save_entry_key_press_event),
 			  NULL);
 
-	gtk_widget_show_now (toplevel);
+	if (!file_from_command_line)
+		gtk_widget_show_now (toplevel);
+	
+
 	release_lock ();
+	
+	if (file_from_command_line)
+	{
+		if (gimme_file (file_from_command_line))
+			g_free (file_from_command_line);
+
+		exit (0);
+	}
 
 	/*
 	 * Start working on the temporary file in a fork, now this is
@@ -1302,14 +1316,16 @@
 	 * process.  But it makes it snappy and makes dnd not hang.  Go
 	 * figure.
 	 */
-	start_temporary ();
+	if (!file_from_command_line)
+		start_temporary ();
 
 	signal (SIGINT, got_signal);
 	signal (SIGTERM, got_signal);
 
 	gtk_main ();
-
-	cleanup_temporary ();
+	
+	if (!file_from_command_line)
+		cleanup_temporary ();
 
 	return 0;
 }
