This addresses the annoyance that you have to sit and wait for ages if
you want to know all suggestions. I originaly implemented it with an
extra switch, but it is simpler like this and quite intuitive I think.

-- 
Vincent de Phily
Index: suggestions.c
===================================================================
--- suggestions.c	(revision 252)
+++ suggestions.c	(working copy)
@@ -143,4 +143,10 @@
 	displaytime = -1.0;
 }
 
+void print_all_suggestions(void)
+{
+	struct suggestion *ptr;
 
+	for (ptr = suggestions; ptr; ptr = ptr->next)
+		printf("\n%s\n", ptr->string);
+}
Index: powertop.c
===================================================================
--- powertop.c	(revision 252)
+++ powertop.c	(working copy)
@@ -658,8 +658,6 @@
 		if (wakeups_per_second < 0)
 			ticktime = 2;
 
-		if (dump)
-			exit(EXIT_SUCCESS);
 		reset_suggestions();
 
 		suggest_kernel_config("CONFIG_USB_SUSPEND", 1,
@@ -742,6 +740,11 @@
 		suggest_writeback_time();
 		suggest_usb_autosuspend();
 
+		if (dump) {
+			print_all_suggestions();
+			exit(EXIT_SUCCESS);
+		}
+
 		if (!key)
 			pick_suggestion();
 		show_title_bar();
Index: powertop.h
===================================================================
--- powertop.h	(revision 252)
+++ powertop.h	(working copy)
@@ -107,6 +107,7 @@
 void pick_suggestion(void);
 void add_suggestion(char *text, int weight, char key, char *keystring, suggestion_func *func);
 void reset_suggestions(void);
+void print_all_suggestions(void);
 
 
 void  do_cpufreq_stats(void);
_______________________________________________
Power mailing list
[email protected]
http://www.bughost.org/mailman/listinfo/power

Reply via email to