*/
static int persistent;
+/**
+ * Quiet mode
+ */
+static int quiet;
+
/**
* Callback function to process statistic values.
*
printer (void *cls, const char *subsystem, const char *name, uint64_t value,
int is_persistent)
{
- FPRINTF (stdout, "%s%-12s %-50s: %16llu\n", is_persistent ? "!" : " ",
+ if (quiet == GNUNET_NO)
+ FPRINTF (stdout, "%s%-12s %-50s: %16llu\n", is_persistent ? "!" : " ",
subsystem, _(name), (unsigned long long) value);
+ else
+ FPRINTF (stdout, "%llu\n", (unsigned long long) value);
+
return GNUNET_OK;
}
{
static const struct GNUNET_GETOPT_CommandLineOption options[] = {
{'n', "name", "NAME",
- gettext_noop ("limit output to statistcs for the given NAME"), 1,
+ gettext_noop ("limit output to statistics for the given NAME"), 1,
&GNUNET_GETOPT_set_string, &name},
{'p', "persistent", NULL,
gettext_noop ("make the value being set persistent"), 0,
{'s', "subsystem", "SUBSYSTEM",
gettext_noop ("limit output to the given SUBSYSTEM"), 1,
&GNUNET_GETOPT_set_string, &subsystem},
+ {'q', "quiet", NULL,
+ gettext_noop ("just print the statistics value"), 0,
+ &GNUNET_GETOPT_set_one, &quiet},
GNUNET_GETOPT_OPTION_END
};
return (GNUNET_OK ==