}
void argconfig_print_help(const char *program_desc,
- const struct argconfig_commandline_options *options)
+ struct argconfig_commandline_options *s)
{
- const struct argconfig_commandline_options *s;
-
fprintf(stderr, "\033[1mUsage: %s\033[0m\n\n",
append_usage_str);
print_word_wrapped(program_desc, 0, 0, stderr);
fprintf(stderr, "\n");
- if (!options || !options->option)
+ if (!s || !s->option)
return;
fprintf(stderr, "\n\033[1mOptions:\033[0m\n");
- for (s = options; (s != NULL) && (s->option != NULL); s++)
+ for (; s && s->option; s++)
show_option(s);
}
}
}
-bool argconfig_parse_seen(struct argconfig_commandline_options *options,
+bool argconfig_parse_seen(struct argconfig_commandline_options *s,
const char *option)
{
- struct argconfig_commandline_options *s;
-
- for (s = options; s && s->option; s++) {
+ for (; s && s->option; s++) {
if (!strcmp(s->option, option))
- return s->seen;;
+ return s->seen;
}
return false;
typedef void argconfig_help_func();
void argconfig_append_usage(const char *str);
void argconfig_print_help(const char *program_desc,
- const struct argconfig_commandline_options *options);
+ struct argconfig_commandline_options *options);
int argconfig_parse(int argc, char *argv[], const char *program_desc,
struct argconfig_commandline_options *options);
int argconfig_parse_subopt_string(char *string, char **options,