aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--doc/man/gnunet-config.13
-rw-r--r--src/ats/ats_api_scheduling.c2
-rw-r--r--src/util/gnunet-config.c31
3 files changed, 33 insertions, 3 deletions
diff --git a/doc/man/gnunet-config.1 b/doc/man/gnunet-config.1
index 3a7fa624b..6b4b82001 100644
--- a/doc/man/gnunet-config.1
+++ b/doc/man/gnunet-config.1
@@ -19,6 +19,9 @@ When accessing a specific option using \-s and \-o, perform expansions as if the
19.IP "\-s SECTION, \-\-section=SECTION" 19.IP "\-s SECTION, \-\-section=SECTION"
20Which configuration section should be accessed or edited. Required option. 20Which configuration section should be accessed or edited. Required option.
21.B 21.B
22.IP "\-S, \-\-list\-sections"
23List available configuration sections for use with \-\-section.
24.B
22.IP "\-o OPTION, \-\-option=OPTION" 25.IP "\-o OPTION, \-\-option=OPTION"
23Which 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". 26Which 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".
24.B 27.B
diff --git a/src/ats/ats_api_scheduling.c b/src/ats/ats_api_scheduling.c
index 8d2cdc84e..3bd4cddc7 100644
--- a/src/ats/ats_api_scheduling.c
+++ b/src/ats/ats_api_scheduling.c
@@ -488,7 +488,7 @@ process_ats_address_suggestion_message (void *cls,
488 (GNUNET_HELLO_address_check_option (ar->address, 488 (GNUNET_HELLO_address_check_option (ar->address,
489 GNUNET_HELLO_ADDRESS_INFO_INBOUND)) ) 489 GNUNET_HELLO_ADDRESS_INFO_INBOUND)) )
490 { 490 {
491 GNUNET_assert (0); 491 GNUNET_assert (0); // FIXME: turn back into 'break' later!
492 return; 492 return;
493 } 493 }
494 sh->suggest_cb (sh->suggest_cb_cls, 494 sh->suggest_cb (sh->suggest_cb_cls,
diff --git a/src/util/gnunet-config.c b/src/util/gnunet-config.c
index 1d204dd07..f0acf11e4 100644
--- a/src/util/gnunet-config.c
+++ b/src/util/gnunet-config.c
@@ -48,6 +48,11 @@ static char *value;
48static int is_filename; 48static int is_filename;
49 49
50/** 50/**
51 * Whether to show the sections.
52 */
53static int list_sections;
54
55/**
51 * Return value from 'main'. 56 * Return value from 'main'.
52 */ 57 */
53static int ret; 58static int ret;
@@ -72,6 +77,20 @@ print_option (void *cls, const char *section,
72 77
73 78
74/** 79/**
80 * Print out given section name.
81 *
82 * @param cls unused
83 * @param section a section in the configuration file
84 */
85static void
86print_section_name (void *cls,
87 const char *section)
88{
89 fprintf (stdout, "%s\n", section);
90}
91
92
93/**
75 * Main function that will be run by the scheduler. 94 * Main function that will be run by the scheduler.
76 * 95 *
77 * @param cls closure 96 * @param cls closure
@@ -85,9 +104,14 @@ run (void *cls, char *const *args, const char *cfgfile,
85{ 104{
86 struct GNUNET_CONFIGURATION_Handle *out; 105 struct GNUNET_CONFIGURATION_Handle *out;
87 106
88 if (NULL == section) 107 if (NULL == section || list_sections)
89 { 108 {
90 fprintf (stderr, _("--section argument is required\n")); 109 if (! list_sections)
110 {
111 fprintf (stderr, _("--section argument is required\n"));
112 }
113 fprintf (stderr, _("The following sections are available:\n"));
114 GNUNET_CONFIGURATION_iterate_sections (cfg, &print_section_name, NULL);
91 ret = 1; 115 ret = 1;
92 return; 116 return;
93 } 117 }
@@ -168,6 +192,9 @@ main (int argc, char *const *argv)
168 { 'V', "value", "VALUE", 192 { 'V', "value", "VALUE",
169 gettext_noop ("value to set"), 193 gettext_noop ("value to set"),
170 1, &GNUNET_GETOPT_set_string, &value }, 194 1, &GNUNET_GETOPT_set_string, &value },
195 { 'S', "list-sections", NULL,
196 gettext_noop ("print available configuration sections"),
197 0, &GNUNET_GETOPT_set_one, &list_sections },
171 GNUNET_GETOPT_OPTION_END 198 GNUNET_GETOPT_OPTION_END
172 }; 199 };
173 if (GNUNET_OK != GNUNET_STRINGS_get_utf8_args (argc, argv, &argc, &argv)) 200 if (GNUNET_OK != GNUNET_STRINGS_get_utf8_args (argc, argv, &argc, &argv))