permission store: Add --version

It is expected that --version works.
This commit is contained in:
Matthias Clasen
2016-07-14 23:31:05 -04:00
parent b6db220f7c
commit a92edee9fb

View File

@@ -54,10 +54,12 @@ on_name_lost (GDBusConnection *connection,
static gboolean opt_verbose;
static gboolean opt_replace;
static gboolean opt_version;
static GOptionEntry entries[] = {
{ "verbose", 'v', 0, G_OPTION_ARG_NONE, &opt_verbose, "Print debug information during command processing", NULL },
{ "verbose", 'v', 0, G_OPTION_ARG_NONE, &opt_verbose, "Print debug information", NULL },
{ "replace", 'r', 0, G_OPTION_ARG_NONE, &opt_replace, "Replace", NULL },
{ "version", 0, 0, G_OPTION_ARG_NONE, &opt_version, "Print version and exit", NULL },
{ NULL }
};
@@ -115,6 +117,12 @@ main (int argc,
return 1;
}
if (opt_version)
{
g_print ("%s\n", PACKAGE_STRING);
exit (EXIT_SUCCESS);
}
if (opt_verbose)
g_log_set_handler (G_LOG_DOMAIN, G_LOG_LEVEL_DEBUG, message_handler, NULL);