[PATCH weston] Add --version option.

Scott Moreau oreaus at gmail.com
Wed Aug 29 14:15:58 PDT 2012


---
 src/compositor.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/src/compositor.c b/src/compositor.c
index df28cb7..42d4051 100644
--- a/src/compositor.c
+++ b/src/compositor.c
@@ -3565,6 +3565,7 @@ int main(int argc, char *argv[])
 	int32_t idle_time = 300;
 	int32_t xserver = 0;
 	int32_t help = 0;
+	int32_t version = 0;
 	char *socket_name = NULL;
 	char *config_file;
 
@@ -3585,6 +3586,7 @@ int main(int argc, char *argv[])
 		{ WESTON_OPTION_STRING, "module", 0, &module },
 		{ WESTON_OPTION_STRING, "log", 0, &log },
 		{ WESTON_OPTION_BOOLEAN, "help", 'h', &help },
+		{ WESTON_OPTION_BOOLEAN, "version", 0, &version },
 	};
 
 	argc = parse_options(core_options,
@@ -3593,6 +3595,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"
-- 
1.7.11.4



More information about the wayland-devel mailing list