Jan,

A patch is attached which turns off all output unless given --verbose. I hope
that's what you were looking for.


Adam
diff --git a/src/clients/launcher/xmms2-launcher.c b/src/clients/launcher/xmms2-launcher.c
index ebe4f47..b597e90 100644
--- a/src/clients/launcher/xmms2-launcher.c
+++ b/src/clients/launcher/xmms2-launcher.c
@@ -46,11 +46,13 @@ main (int argc, char **argv)
 	int pipefd[2];
 	const gchar *logfile = NULL;
 	const gchar *pidfile = NULL;
+	static gboolean verbose = FALSE;
 	GError *error = NULL;
 	GOptionContext* context = NULL;
 	GOptionEntry opts[] = {
 		{"logfile", 'l', 0, G_OPTION_ARG_FILENAME, &logfile, "Redirect logs to <file>", "<file>"},
 		{"pidfile", 'P', 0, G_OPTION_ARG_FILENAME, &pidfile, "Save xmms2d pid in <file>", "<file>"},
+		{"verbose", 'v', 0, G_OPTION_ARG_NONE, &verbose, "Verbose", NULL},
 		{NULL}
 	};
 
@@ -58,7 +60,9 @@ main (int argc, char **argv)
 	g_option_context_set_ignore_unknown_options (context, TRUE);
 	g_option_context_add_main_entries (context, opts, NULL);
 	if (!g_option_context_parse (context, &argc, &argv, &error)) {
-		g_print ("xmms2-launcher: %s\n", error->message);
+		if (verbose) {
+			g_print ("xmms2-launcher: %s\n", error->message);
+		}
 		g_clear_error (&error);
 	}
 	g_option_context_free (context);
@@ -76,7 +80,9 @@ main (int argc, char **argv)
 			g_mkdir_with_parents (cache, 0755);
 		}
 	}
-	g_print ("Log output will be stored in %s\n", logfile);
+	if (verbose) {
+		g_print ("Log output will be stored in %s\n", logfile);
+	}
 
 	pid = fork ();
 	if (pid) {
@@ -92,10 +98,14 @@ main (int argc, char **argv)
 		if (res == -1)
 			perror ("read");
 		if (res == 0) {
-			printf ("startup failed!\n");
+                    	if (verbose) {
+				printf ("startup failed!\n");
+                    	}
 			exit (1);
 		}
-		printf("xmms2 started\n");
+		if (verbose) {
+			printf("xmms2 started\n");
+		}
 		exit(0);
 	}
 

Reply via email to