diff options
author | Nathan S. Evans <evans@in.tum.de> | 2010-04-01 08:13:38 +0000 |
---|---|---|
committer | Nathan S. Evans <evans@in.tum.de> | 2010-04-01 08:13:38 +0000 |
commit | eb48917c720068f8f305638d6104e7f1ca686719 (patch) | |
tree | b43b20a4ad0f1d8aa585f78b83437cc6de4ef834 /src | |
parent | ef3b217d7330495dec514027e75e758ebdd4085e (diff) | |
download | gnunet-eb48917c720068f8f305638d6104e7f1ca686719.tar.gz gnunet-eb48917c720068f8f305638d6104e7f1ca686719.zip |
add quiet flag (fix for test case)
Diffstat (limited to 'src')
-rw-r--r-- | src/arm/gnunet-arm.c | 28 |
1 files changed, 22 insertions, 6 deletions
diff --git a/src/arm/gnunet-arm.c b/src/arm/gnunet-arm.c index dd75d3284..2b438b30d 100644 --- a/src/arm/gnunet-arm.c +++ b/src/arm/gnunet-arm.c | |||
@@ -51,6 +51,11 @@ static int start; | |||
51 | static int delete; | 51 | static int delete; |
52 | 52 | ||
53 | /** | 53 | /** |
54 | * Set if we should not print status messages. | ||
55 | */ | ||
56 | static int quiet; | ||
57 | |||
58 | /** | ||
54 | * Set to the name of a service to start. | 59 | * Set to the name of a service to start. |
55 | */ | 60 | */ |
56 | static char *init; | 61 | static char *init; |
@@ -127,14 +132,17 @@ confirm_cb (void *cls, int success) | |||
127 | switch (success) | 132 | switch (success) |
128 | { | 133 | { |
129 | case GNUNET_OK: | 134 | case GNUNET_OK: |
130 | GNUNET_log (GNUNET_ERROR_TYPE_INFO, _("Service `%s' is now running.\n"), service); | 135 | if (quiet != GNUNET_YES) |
136 | fprintf(stdout, _("Service `%s' is now running.\n"), service); | ||
131 | break; | 137 | break; |
132 | case GNUNET_NO: | 138 | case GNUNET_NO: |
133 | GNUNET_log (GNUNET_ERROR_TYPE_INFO, _("Service `%s' is not running.\n"), service); | 139 | if (quiet != GNUNET_YES) |
140 | fprintf(stdout, _("Service `%s' is not running.\n"), service); | ||
134 | break; | 141 | break; |
135 | case GNUNET_SYSERR: | 142 | case GNUNET_SYSERR: |
136 | GNUNET_log (GNUNET_ERROR_TYPE_WARNING, | 143 | if (quiet != GNUNET_YES) |
137 | _("Error updating service `%s': ARM not running\n"), service); | 144 | fprintf(stdout, |
145 | _("Error updating service `%s': ARM not running\n"), service); | ||
138 | break; | 146 | break; |
139 | } | 147 | } |
140 | GNUNET_SCHEDULER_add_continuation (sched, | 148 | GNUNET_SCHEDULER_add_continuation (sched, |
@@ -157,9 +165,15 @@ confirm_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | |||
157 | const char *service = cls; | 165 | const char *service = cls; |
158 | 166 | ||
159 | if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_PREREQ_DONE)) | 167 | if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_PREREQ_DONE)) |
160 | GNUNET_log (GNUNET_ERROR_TYPE_INFO, _("Service `%s' is running.\n"), service); | 168 | { |
169 | if (quiet != GNUNET_YES) | ||
170 | fprintf(stdout, _("Service `%s' is running.\n"), service); | ||
171 | } | ||
161 | else | 172 | else |
162 | GNUNET_log (GNUNET_ERROR_TYPE_INFO, _("Service `%s' is not running.\n"), service); | 173 | { |
174 | if (quiet != GNUNET_YES) | ||
175 | fprintf(stdout, _("Service `%s' is not running.\n"), service); | ||
176 | } | ||
163 | GNUNET_SCHEDULER_add_continuation (sched, | 177 | GNUNET_SCHEDULER_add_continuation (sched, |
164 | &cps_loop, | 178 | &cps_loop, |
165 | NULL, | 179 | NULL, |
@@ -305,6 +319,8 @@ static struct GNUNET_GETOPT_CommandLineOption options[] = { | |||
305 | GNUNET_YES, &GNUNET_GETOPT_set_string, &test}, | 319 | GNUNET_YES, &GNUNET_GETOPT_set_string, &test}, |
306 | {'d', "delete", NULL, gettext_noop ("delete config file and directory on exit"), | 320 | {'d', "delete", NULL, gettext_noop ("delete config file and directory on exit"), |
307 | GNUNET_NO, &GNUNET_GETOPT_set_one, &delete}, | 321 | GNUNET_NO, &GNUNET_GETOPT_set_one, &delete}, |
322 | {'q', "quiet", NULL, gettext_noop ("don't print status messages"), | ||
323 | GNUNET_NO, &GNUNET_GETOPT_set_one, &quiet}, | ||
308 | GNUNET_GETOPT_OPTION_END | 324 | GNUNET_GETOPT_OPTION_END |
309 | }; | 325 | }; |
310 | 326 | ||