.dumper = (cf_dumper1*) teapot_temperature_dumper
};
-static void opt_test_hook(struct opt_item * opt, const char * value, void * data) {
+static void opt_test_hook(struct opt_item * opt, uns event UNUSED, const char * value, void * data) {
if (!show_hooks)
return;
if (opt)
}
};
-static struct opt_section help = {
+static struct opt_section options = {
OPT_ITEMS {
OPT_HELP("A simple tea boiling console."),
OPT_HELP("Usage: teapot [options] name-of-the-tea"),
OPT_HELP("At least one kind of tea must be specified."),
OPT_HELP(""),
OPT_HELP("Options:"),
- OPT_HELP_OPTION(help),
+ OPT_HELP_OPTION,
OPT_CALL('V', "version", show_version, NULL, OPT_NO_VALUE, "\tShow the version"),
OPT_HELP(""),
OPT_BOOL('e', "english-style", english, 0, "\tEnglish style (with milk)"),
OPT_HOOK(opt_test_hook, "preval", OPT_HOOK_BEFORE_VALUE),
OPT_HOOK(opt_test_hook, "postval", OPT_HOOK_AFTER_VALUE),
OPT_BOOL('H', "show-hooks", show_hooks, 0, "\tDemonstrate the hooks."),
+ OPT_HELP(""),
+ OPT_HELP("Configuration options:"),
OPT_CONF_OPTIONS,
OPT_END
}
int main(int argc UNUSED, char ** argv)
{
+ cf_def_file = "etc/libucw";
clist_init(&black_magic);
- opt_parse(&help, argv+1);
+ opt_parse(&options, argv+1);
printf("English style: %s|", english ? "yes" : "no");
if (sugar)