Add an option parser

On one hand, getopt (in particular the -o suboption syntax) sucks on the
server side, and on the client side we would like to avoid the glib
dependency.  We can roll out own option parser and solve both problems
and save a few lines of code total.
diff --git a/clients/terminal.c b/clients/terminal.c
index 65fec38..45d4f12 100644
--- a/clients/terminal.c
+++ b/clients/terminal.c
@@ -2362,10 +2362,8 @@
 	return 0;
 }
 
-static const GOptionEntry option_entries[] = {
-	{ "fullscreen", 'f', 0, G_OPTION_ARG_NONE,
-	  &option_fullscreen, "Run in fullscreen mode" },
-	{ NULL }
+static const struct weston_option terminal_options[] = {
+	{ WESTON_OPTION_BOOLEAN, "fullscreen", 'f', &option_fullscreen },
 };
 
 int main(int argc, char *argv[])
@@ -2374,7 +2372,10 @@
 	struct terminal *terminal;
 	const char *shell;
 
-	d = display_create(&argc, &argv, option_entries);
+	argc = parse_options(terminal_options,
+			     ARRAY_LENGTH(terminal_options), argc, argv);
+
+	d = display_create(argc, argv);
 	if (d == NULL) {
 		fprintf(stderr, "failed to create display: %m\n");
 		return -1;