diff options
author | Scott Moreau <oreaus@gmail.com> | 2012-08-29 15:15:58 -0600 |
---|---|---|
committer | Kristian Høgsberg <krh@bitplanet.net> | 2013-02-14 16:00:02 -0500 |
commit | 8877173f0ca73b2b454c2eb228374b59e5d544ab (patch) | |
tree | 95dfd3b7fa1880680df55bee1686c57ade409a26 | |
parent | b65a207388840eb51d1cd74aaba9863c4423d21c (diff) | |
download | weston-8877173f0ca73b2b454c2eb228374b59e5d544ab.tar.gz |
Add --version option
-rw-r--r-- | man/weston.man | 5 | ||||
-rw-r--r-- | src/compositor.c | 8 |
2 files changed, 12 insertions, 1 deletions
diff --git a/man/weston.man b/man/weston.man index 4523ceb5..a6aa9cb3 100644 --- a/man/weston.man +++ b/man/weston.man @@ -104,8 +104,11 @@ or you can pass an absolute path. The default backend is unless the environment suggests otherwise, see .IR DISPLAY " and " WAYLAND_DISPLAY . .TP +.BR \-\-version +Print the program version. +.TP .BR \-\^h ", " \-\-help -Print the program version and a summary of command line options, and quit. +Print a summary of command line options, and quit. .TP \fB\-\^i\fR\fIN\fR, \fB\-\-idle\-time\fR=\fIN\fR Set the idle timeout to diff --git a/src/compositor.c b/src/compositor.c index bab6c82e..c2e53878 100644 --- a/src/compositor.c +++ b/src/compositor.c @@ -3049,6 +3049,7 @@ usage(int error_code) "Core options:\n\n" + " --version\t\tPrint weston version\n" " -B, --backend=MODULE\tBackend module, one of drm-backend.so,\n" "\t\t\t\tx11-backend.so or wayland-backend.so\n" " -S, --socket=NAME\tName of socket to listen on\n" @@ -3099,6 +3100,7 @@ int main(int argc, char *argv[]) int32_t idle_time = 300; int32_t help = 0; char *socket_name = "wayland-0"; + int32_t version = 0; char *config_file; const struct config_key core_config_keys[] = { @@ -3117,6 +3119,7 @@ int main(int argc, char *argv[]) { WESTON_OPTION_STRING, "modules", 0, &option_modules }, { WESTON_OPTION_STRING, "log", 0, &log }, { WESTON_OPTION_BOOLEAN, "help", 'h', &help }, + { WESTON_OPTION_BOOLEAN, "version", 0, &version }, }; argc = parse_options(core_options, @@ -3125,6 +3128,11 @@ int main(int argc, char *argv[]) if (help) usage(EXIT_SUCCESS); + if (version) { + printf(PACKAGE_STRING "\n"); + return EXIT_SUCCESS; + } + weston_log_file_open(log); weston_log("%s\n" |