#include "options.h" #include "conf.h" #include #include void options_parse(int argc, char **argv, struct options *options) { GError *error = NULL; GOptionContext *context; GOptionEntry entries[] = { {"daemonize", 'd', G_OPTION_FLAG_NO_ARG, G_OPTION_ARG_NONE, &options->daemonize, NULL, NULL}, {"kill", 'k', G_OPTION_FLAG_NO_ARG, G_OPTION_ARG_NONE, &options->kill, NULL, NULL}, {NULL}, }; context = g_option_context_new(NULL); g_option_context_set_summary(context, "audist daemon"); g_option_context_add_main_entries(context, entries, NULL); if(g_option_context_parse(context, &argc, &argv, &error) == FALSE) { g_warning(error->message); g_error_free(error); exit(1); } }