[util] Remove unused pre_parse callback logic
This commit is contained in:
parent
09e4d7dd30
commit
fe90fbeba3
|
@ -108,17 +108,6 @@ option_parser_t::add_main_options ()
|
||||||
g_option_context_add_main_entries (context, entries, nullptr);
|
g_option_context_add_main_entries (context, entries, nullptr);
|
||||||
}
|
}
|
||||||
|
|
||||||
static gboolean
|
|
||||||
pre_parse (GOptionContext *context G_GNUC_UNUSED,
|
|
||||||
GOptionGroup *group G_GNUC_UNUSED,
|
|
||||||
gpointer data,
|
|
||||||
GError **error)
|
|
||||||
{
|
|
||||||
option_group_t *option_group = (option_group_t *) data;
|
|
||||||
option_group->pre_parse (error);
|
|
||||||
return !*error;
|
|
||||||
}
|
|
||||||
|
|
||||||
static gboolean
|
static gboolean
|
||||||
post_parse (GOptionContext *context G_GNUC_UNUSED,
|
post_parse (GOptionContext *context G_GNUC_UNUSED,
|
||||||
GOptionGroup *group G_GNUC_UNUSED,
|
GOptionGroup *group G_GNUC_UNUSED,
|
||||||
|
@ -140,7 +129,7 @@ option_parser_t::add_group (GOptionEntry *entries,
|
||||||
GOptionGroup *group = g_option_group_new (name, description, help_description,
|
GOptionGroup *group = g_option_group_new (name, description, help_description,
|
||||||
static_cast<gpointer>(option_group), nullptr);
|
static_cast<gpointer>(option_group), nullptr);
|
||||||
g_option_group_add_entries (group, entries);
|
g_option_group_add_entries (group, entries);
|
||||||
g_option_group_set_parse_hooks (group, pre_parse, post_parse);
|
g_option_group_set_parse_hooks (group, nullptr, post_parse);
|
||||||
g_option_context_add_group (context, group);
|
g_option_context_add_group (context, group);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -57,7 +57,6 @@ struct option_group_t
|
||||||
{
|
{
|
||||||
virtual ~option_group_t () {}
|
virtual ~option_group_t () {}
|
||||||
|
|
||||||
virtual void pre_parse (GError **error G_GNUC_UNUSED) {}
|
|
||||||
virtual void post_parse (GError **error G_GNUC_UNUSED) {}
|
virtual void post_parse (GError **error G_GNUC_UNUSED) {}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue