[tracker/tracker-control-no-args: 1/4] tracker-control: Assume --list-processes and --status when running without args



commit eb546b47b895b38e57819aeccf5b5d498fbd057b
Author: Aleksander Morgado <aleksander lanedo com>
Date:   Mon Mar 21 12:49:18 2011 +0100

    tracker-control: Assume --list-processes and --status when running without args
    
    Fixes GB#645000

 src/tracker-control/tracker-control-general.c |    9 +++++++++
 src/tracker-control/tracker-control-miners.c  |    6 ++++++
 src/tracker-control/tracker-control-status.c  |   11 +++++++++++
 src/tracker-control/tracker-control.c         |   14 +++++++++-----
 src/tracker-control/tracker-control.h         |    3 +++
 5 files changed, 38 insertions(+), 5 deletions(-)
---
diff --git a/src/tracker-control/tracker-control-general.c b/src/tracker-control/tracker-control-general.c
index c2314a2..2ef09c6 100644
--- a/src/tracker-control/tracker-control-general.c
+++ b/src/tracker-control/tracker-control-general.c
@@ -236,6 +236,15 @@ term_option_arg_func (const gchar  *option_value,
 	return TRUE;
 }
 
+void
+tracker_control_general_run_default (void)
+{
+	/* Enable list processes in the default run */
+	list_processes = TRUE;
+
+	tracker_control_general_run ();
+}
+
 gint
 tracker_control_general_run (void)
 {
diff --git a/src/tracker-control/tracker-control-miners.c b/src/tracker-control/tracker-control-miners.c
index b092e16..f3a5f1c 100644
--- a/src/tracker-control/tracker-control-miners.c
+++ b/src/tracker-control/tracker-control-miners.c
@@ -359,6 +359,12 @@ miner_pause_details (void)
 	return EXIT_SUCCESS;
 }
 
+void
+tracker_control_miners_run_default (void)
+{
+	/* No miners output in the default run */
+}
+
 gint
 tracker_control_miners_run (void)
 {
diff --git a/src/tracker-control/tracker-control-status.c b/src/tracker-control/tracker-control-status.c
index 6cbb111..cffdc5b 100644
--- a/src/tracker-control/tracker-control-status.c
+++ b/src/tracker-control/tracker-control-status.c
@@ -440,6 +440,15 @@ store_init (void)
 	return TRUE;
 }
 
+void
+tracker_control_status_run_default (void)
+{
+	/* Enable status output in the default run */
+	status = TRUE;
+
+	tracker_control_status_run ();
+}
+
 gint
 tracker_control_status_run (void)
 {
@@ -487,6 +496,8 @@ tracker_control_status_run (void)
 
 		g_print ("\n");
 
+		return;
+
 		g_print ("%s:\n", _("Miners"));
 
 		for (l = miners_available; l; l = l->next) {
diff --git a/src/tracker-control/tracker-control.c b/src/tracker-control/tracker-control.c
index 0fa8a8d..23f3b86 100644
--- a/src/tracker-control/tracker-control.c
+++ b/src/tracker-control/tracker-control.c
@@ -127,7 +127,7 @@ main (int argc, char **argv)
 		return tracker_control_miners_run ();
 	}
 
-
+	/* Unknown options? */
 	if (argc > 1) {
 		gint i = 1;
 
@@ -138,10 +138,14 @@ main (int argc, char **argv)
 			            argv[i],
 			            i == (argc - 1) ? "\n" : ", ");
 		}
-	} else {
-		g_printerr ("%s\n",
-		            _("No options specified"));
+		return EXIT_FAILURE;
 	}
 
-	return EXIT_FAILURE;
+	/* No-args output */
+	tracker_control_general_run_default ();
+	printf ("\n");
+	tracker_control_status_run_default ();
+	printf ("\n");
+	tracker_control_miners_run_default ();
+	return EXIT_SUCCESS;
 }
diff --git a/src/tracker-control/tracker-control.h b/src/tracker-control/tracker-control.h
index dfa0333..dc33d4c 100644
--- a/src/tracker-control/tracker-control.h
+++ b/src/tracker-control/tracker-control.h
@@ -24,14 +24,17 @@
 
 GOptionGroup *tracker_control_general_get_option_group (void);
 gint          tracker_control_general_run              (void);
+void          tracker_control_general_run_default      (void);
 gboolean      tracker_control_general_options_enabled  (void);
 
 GOptionGroup *tracker_control_status_get_option_group  (void);
 gint          tracker_control_status_run               (void);
+void          tracker_control_status_run_default       (void);
 gboolean      tracker_control_status_options_enabled   (void);
 
 GOptionGroup *tracker_control_miners_get_option_group  (void);
 gint          tracker_control_miners_run               (void);
+void          tracker_control_miners_run_default       (void);
 gboolean      tracker_control_miners_options_enabled   (void);
 
 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]