feedbackd: Add --version option
Signed-off-by: Guido Günther <agx@sigxcpu.org>
This commit is contained in:
@@ -44,6 +44,9 @@ Options
|
||||
``-r``, ``--replace``
|
||||
replace a running instance
|
||||
|
||||
``--version``
|
||||
print version and exit
|
||||
|
||||
Configuration
|
||||
=============
|
||||
|
||||
|
||||
@@ -9,6 +9,8 @@
|
||||
|
||||
#define G_LOG_DOMAIN "fbd"
|
||||
|
||||
#include "fbd-config.h"
|
||||
|
||||
#include "fbd.h"
|
||||
#include "fbd-feedback-manager.h"
|
||||
#include "fbd-haptic-manager.h"
|
||||
@@ -127,7 +129,7 @@ int
|
||||
main (int argc, char *argv[])
|
||||
{
|
||||
g_autoptr (GError) err = NULL;
|
||||
gboolean opt_verbose = FALSE, opt_replace = FALSE;
|
||||
gboolean opt_verbose = FALSE, opt_replace = FALSE, opt_version = FALSE;
|
||||
g_autoptr (GOptionContext) opt_context = NULL;
|
||||
g_autoptr (FbdFeedbackManager) manager = NULL;
|
||||
gboolean ret = EXIT_SUCCESS;
|
||||
@@ -136,6 +138,7 @@ main (int argc, char *argv[])
|
||||
{ "verbose", 'v', 0, G_OPTION_ARG_NONE, &opt_verbose,
|
||||
"Print debug information during command processing", NULL },
|
||||
{ "replace", 'r', 0, G_OPTION_ARG_NONE, &opt_replace, "Replace a running instance", NULL },
|
||||
{ "version", 0, 0, G_OPTION_ARG_NONE, &opt_version, "Print program version", NULL },
|
||||
{ NULL }
|
||||
};
|
||||
|
||||
@@ -147,6 +150,11 @@ main (int argc, char *argv[])
|
||||
return 1;
|
||||
}
|
||||
|
||||
if (opt_version) {
|
||||
g_print (PACKAGE_NAME " " PACKAGE_VERSION "\n");
|
||||
return EXIT_SUCCESS;
|
||||
}
|
||||
|
||||
if (opt_verbose)
|
||||
g_log_writer_default_set_debug_domains ((const char *const[]){ "all", NULL });
|
||||
|
||||
|
||||
@@ -3,6 +3,7 @@ if get_option('daemon')
|
||||
|
||||
config_h = configuration_data()
|
||||
config_h.set_quoted('PACKAGE_VERSION', meson.project_version())
|
||||
config_h.set_quoted('PACKAGE_NAME', meson.project_name())
|
||||
config_h.set('FBD_USE_MEDIA_ROLES', get_option('media-roles'))
|
||||
configure_file(output: 'fbd-config.h', configuration: config_h)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user