weston-terminal --help and other command-line options
authorBill Spitzak <spitzak@gmail.com>
Fri, 8 Aug 2014 19:59:55 +0000 (12:59 -0700)
committerPekka Paalanen <pekka.paalanen@collabora.co.uk>
Tue, 19 Aug 2014 09:19:17 +0000 (12:19 +0300)
Option array existed but was unused. Added --font-size.

clients/terminal.c

index 0bacbe0..7c37101 100644 (file)
@@ -3042,6 +3042,7 @@ terminal_run(struct terminal *terminal, const char *path)
 static const struct weston_option terminal_options[] = {
        { WESTON_OPTION_BOOLEAN, "fullscreen", 'f', &option_fullscreen },
        { WESTON_OPTION_STRING, "font", 0, &option_font },
+       { WESTON_OPTION_INTEGER, "font-size", 0, &option_font_size },
        { WESTON_OPTION_STRING, "shell", 0, &option_shell },
 };
 
@@ -3067,6 +3068,16 @@ int main(int argc, char *argv[])
        weston_config_section_get_string(s, "term", &option_term, "xterm");
        weston_config_destroy(config);
 
+       if (parse_options(terminal_options,
+                         ARRAY_LENGTH(terminal_options), &argc, argv) > 1) {
+               printf("Usage: %s [OPTIONS]\n"
+                      "  --fullscreen or -f\n"
+                      "  --font=NAME\n"
+                      "  --font-size=SIZE\n"
+                      "  --shell=NAME\n", argv[0]);
+               return 1;
+       }
+
        d = display_create(&argc, argv);
        if (d == NULL) {
                fprintf(stderr, "failed to create display: %m\n");