diff options
Diffstat (limited to 'src/util/gnunet-config.c')
-rw-r--r-- | src/util/gnunet-config.c | 61 |
1 files changed, 36 insertions, 25 deletions
diff --git a/src/util/gnunet-config.c b/src/util/gnunet-config.c index fb3b9ebf9..5f7d9fc0d 100644 --- a/src/util/gnunet-config.c +++ b/src/util/gnunet-config.c | |||
@@ -72,12 +72,17 @@ static int rewrite; | |||
72 | * @param value value of the option | 72 | * @param value value of the option |
73 | */ | 73 | */ |
74 | static void | 74 | static void |
75 | print_option (void *cls, const char *section, | 75 | print_option (void *cls, |
76 | const char *section, | ||
76 | const char *option, | 77 | const char *option, |
77 | const char *value) | 78 | const char *value) |
78 | { | 79 | { |
80 | (void) cls; | ||
81 | (void) section; | ||
79 | fprintf (stdout, | 82 | fprintf (stdout, |
80 | "%s = %s\n", option, value); | 83 | "%s = %s\n", |
84 | option, | ||
85 | value); | ||
81 | } | 86 | } |
82 | 87 | ||
83 | 88 | ||
@@ -91,7 +96,10 @@ static void | |||
91 | print_section_name (void *cls, | 96 | print_section_name (void *cls, |
92 | const char *section) | 97 | const char *section) |
93 | { | 98 | { |
94 | fprintf (stdout, "%s\n", section); | 99 | (void) cls; |
100 | fprintf (stdout, | ||
101 | "%s\n", | ||
102 | section); | ||
95 | } | 103 | } |
96 | 104 | ||
97 | 105 | ||
@@ -112,6 +120,8 @@ run (void *cls, | |||
112 | struct GNUNET_CONFIGURATION_Handle *out = NULL; | 120 | struct GNUNET_CONFIGURATION_Handle *out = NULL; |
113 | struct GNUNET_CONFIGURATION_Handle *diff = NULL; | 121 | struct GNUNET_CONFIGURATION_Handle *diff = NULL; |
114 | 122 | ||
123 | (void) cls; | ||
124 | (void) args; | ||
115 | if (rewrite) | 125 | if (rewrite) |
116 | { | 126 | { |
117 | struct GNUNET_CONFIGURATION_Handle *def; | 127 | struct GNUNET_CONFIGURATION_Handle *def; |
@@ -221,36 +231,37 @@ run (void *cls, | |||
221 | * @return 0 ok, 1 on error | 231 | * @return 0 ok, 1 on error |
222 | */ | 232 | */ |
223 | int | 233 | int |
224 | main (int argc, char *const *argv) | 234 | main (int argc, |
235 | char *const *argv) | ||
225 | { | 236 | { |
226 | struct GNUNET_GETOPT_CommandLineOption options[] = { | 237 | struct GNUNET_GETOPT_CommandLineOption options[] = { |
227 | GNUNET_GETOPT_option_flag ('f', | 238 | GNUNET_GETOPT_option_flag ('f', |
228 | "filename", | 239 | "filename", |
229 | gettext_noop ("obtain option of value as a filename (with $-expansion)"), | 240 | gettext_noop ("obtain option of value as a filename (with $-expansion)"), |
230 | &is_filename), | 241 | &is_filename), |
231 | GNUNET_GETOPT_option_string ('s', | 242 | GNUNET_GETOPT_option_string ('s', |
232 | "section", | 243 | "section", |
233 | "SECTION", | 244 | "SECTION", |
234 | gettext_noop ("name of the section to access"), | 245 | gettext_noop ("name of the section to access"), |
235 | §ion), | 246 | §ion), |
236 | GNUNET_GETOPT_option_string ('o', | 247 | GNUNET_GETOPT_option_string ('o', |
237 | "option", | 248 | "option", |
238 | "OPTION", | 249 | "OPTION", |
239 | gettext_noop ("name of the option to access"), | 250 | gettext_noop ("name of the option to access"), |
240 | &option), | 251 | &option), |
241 | GNUNET_GETOPT_option_string ('V', | 252 | GNUNET_GETOPT_option_string ('V', |
242 | "value", | 253 | "value", |
243 | "VALUE", | 254 | "VALUE", |
244 | gettext_noop ("value to set"), | 255 | gettext_noop ("value to set"), |
245 | &value), | 256 | &value), |
246 | GNUNET_GETOPT_option_flag ('S', | 257 | GNUNET_GETOPT_option_flag ('S', |
247 | "list-sections", | 258 | "list-sections", |
248 | gettext_noop ("print available configuration sections"), | 259 | gettext_noop ("print available configuration sections"), |
249 | &list_sections), | 260 | &list_sections), |
250 | GNUNET_GETOPT_option_flag ('w', | 261 | GNUNET_GETOPT_option_flag ('w', |
251 | "rewrite", | 262 | "rewrite", |
252 | gettext_noop ("write configuration file that only contains delta to defaults"), | 263 | gettext_noop ("write configuration file that only contains delta to defaults"), |
253 | &rewrite), | 264 | &rewrite), |
254 | GNUNET_GETOPT_OPTION_END | 265 | GNUNET_GETOPT_OPTION_END |
255 | }; | 266 | }; |
256 | if (GNUNET_OK != | 267 | if (GNUNET_OK != |