[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] r35013 - in gnunet: doc/man src/ats src/util
From: |
gnunet |
Subject: |
[GNUnet-SVN] r35013 - in gnunet: doc/man src/ats src/util |
Date: |
Mon, 26 Jan 2015 20:03:03 +0100 |
Author: grothoff
Date: 2015-01-26 20:03:03 +0100 (Mon, 26 Jan 2015)
New Revision: 35013
Modified:
gnunet/doc/man/gnunet-config.1
gnunet/src/ats/ats_api_scheduling.c
gnunet/src/util/gnunet-config.c
Log:
patches from Hellekin to fix #3577
Modified: gnunet/doc/man/gnunet-config.1
===================================================================
--- gnunet/doc/man/gnunet-config.1 2015-01-26 16:46:19 UTC (rev 35012)
+++ gnunet/doc/man/gnunet-config.1 2015-01-26 19:03:03 UTC (rev 35013)
@@ -19,6 +19,9 @@
.IP "\-s SECTION, \-\-section=SECTION"
Which configuration section should be accessed or edited. Required option.
.B
+.IP "\-S, \-\-list\-sections"
+List available configuration sections for use with \-\-section.
+.B
.IP "\-o OPTION, \-\-option=OPTION"
Which configuration option should be accessed or edited. Required to set a
value. If not given, all values of a given section will be printed in the
format "OPTION = VALUE".
.B
Modified: gnunet/src/ats/ats_api_scheduling.c
===================================================================
--- gnunet/src/ats/ats_api_scheduling.c 2015-01-26 16:46:19 UTC (rev 35012)
+++ gnunet/src/ats/ats_api_scheduling.c 2015-01-26 19:03:03 UTC (rev 35013)
@@ -488,7 +488,7 @@
(GNUNET_HELLO_address_check_option (ar->address,
GNUNET_HELLO_ADDRESS_INFO_INBOUND))
)
{
- GNUNET_assert (0);
+ GNUNET_assert (0); // FIXME: turn back into 'break' later!
return;
}
sh->suggest_cb (sh->suggest_cb_cls,
Modified: gnunet/src/util/gnunet-config.c
===================================================================
--- gnunet/src/util/gnunet-config.c 2015-01-26 16:46:19 UTC (rev 35012)
+++ gnunet/src/util/gnunet-config.c 2015-01-26 19:03:03 UTC (rev 35013)
@@ -48,6 +48,11 @@
static int is_filename;
/**
+ * Whether to show the sections.
+ */
+static int list_sections;
+
+/**
* Return value from 'main'.
*/
static int ret;
@@ -72,6 +77,20 @@
/**
+ * Print out given section name.
+ *
+ * @param cls unused
+ * @param section a section in the configuration file
+ */
+static void
+print_section_name (void *cls,
+ const char *section)
+{
+ fprintf (stdout, "%s\n", section);
+}
+
+
+/**
* Main function that will be run by the scheduler.
*
* @param cls closure
@@ -85,9 +104,14 @@
{
struct GNUNET_CONFIGURATION_Handle *out;
- if (NULL == section)
+ if (NULL == section || list_sections)
{
- fprintf (stderr, _("--section argument is required\n"));
+ if (! list_sections)
+ {
+ fprintf (stderr, _("--section argument is required\n"));
+ }
+ fprintf (stderr, _("The following sections are available:\n"));
+ GNUNET_CONFIGURATION_iterate_sections (cfg, &print_section_name, NULL);
ret = 1;
return;
}
@@ -168,6 +192,9 @@
{ 'V', "value", "VALUE",
gettext_noop ("value to set"),
1, &GNUNET_GETOPT_set_string, &value },
+ { 'S', "list-sections", NULL,
+ gettext_noop ("print available configuration sections"),
+ 0, &GNUNET_GETOPT_set_one, &list_sections },
GNUNET_GETOPT_OPTION_END
};
if (GNUNET_OK != GNUNET_STRINGS_get_utf8_args (argc, argv, &argc, &argv))
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [GNUnet-SVN] r35013 - in gnunet: doc/man src/ats src/util,
gnunet <=