⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 249003 in webkit


Ignore:
Timestamp:
Aug 22, 2019, 4:18:58 AM (7 years ago)
Author:
clopez@igalia.com
Message:

[GTK][WPE] Support for command "--version" on the MiniBrowser
https://bugs.webkit.org/show_bug.cgi?id=200978

Reviewed by Žan Doberšek.

Printing the engine version used from the MiniBrowser is useful.
For example, the test scripts on WPT can use this info to better
tag the generated results.

  • MiniBrowser/gtk/main.c: Print the engine version when called with --version or -v.

(main):

  • MiniBrowser/wpe/main.cpp: Ditto.

(main):

Location:
trunk/Tools
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Tools/ChangeLog

    r249001 r249003  
     12019-08-22  Carlos Alberto Lopez Perez  <clopez@igalia.com>
     2
     3        [GTK][WPE] Support for command "--version" on the MiniBrowser
     4        https://bugs.webkit.org/show_bug.cgi?id=200978
     5
     6        Reviewed by Žan Doberšek.
     7
     8        Printing the engine version used from the MiniBrowser is useful.
     9        For example, the test scripts on WPT can use this info to better
     10        tag the generated results.
     11
     12        * MiniBrowser/gtk/main.c: Print the engine version when called with --version or -v.
     13        (main):
     14        * MiniBrowser/wpe/main.cpp: Ditto.
     15        (main):
     16
    1172019-08-22  Youenn Fablet  <youenn@apple.com>
    218
  • trunk/Tools/MiniBrowser/gtk/main.c

    r246790 r249003  
    5454static const char *proxy;
    5555static gboolean darkMode;
     56static gboolean printVersion;
    5657
    5758typedef enum {
     
    117118    { "ignore-tls-errors", 0, 0, G_OPTION_ARG_NONE, &ignoreTLSErrors, "Ignore TLS errors", NULL },
    118119    { "content-filter", 0, 0, G_OPTION_ARG_FILENAME, &contentFilter, "JSON with content filtering rules", "FILE" },
     120    { "version", 'v', 0, G_OPTION_ARG_NONE, &printVersion, "Print the WebKitGTK version", NULL },
    119121    { G_OPTION_REMAINING, 0, 0, G_OPTION_ARG_FILENAME_ARRAY, &uriArguments, 0, "[URL…]" },
    120122    { 0, 0, 0, 0, 0, 0, 0 }
     
    519521    g_option_context_free (context);
    520522
     523    if (printVersion) {
     524        g_print("WebKitGTK %d.%d.%d\n",
     525            webkit_get_major_version(),
     526            webkit_get_minor_version(),
     527            webkit_get_micro_version());
     528        return 0;
     529    }
     530
    521531    WebKitWebContext *webContext = (privateMode || automationMode) ? webkit_web_context_new_ephemeral() : webkit_web_context_get_default();
    522532
  • trunk/Tools/MiniBrowser/wpe/main.cpp

    r245565 r249003  
    4949static const char* proxy;
    5050const char* bgColor;
     51static gboolean printVersion;
    5152
    5253static const GOptionEntry commandLineOptions[] =
     
    6263    { "content-filter", 0, 0, G_OPTION_ARG_FILENAME, &contentFilter, "JSON with content filtering rules", "FILE" },
    6364    { "bg-color", 0, 0, G_OPTION_ARG_STRING, &bgColor, "Window background color. Default: white", "COLOR" },
     65    { "version", 'v', 0, G_OPTION_ARG_NONE, &printVersion, "Print the WPE version", nullptr },
    6466    { G_OPTION_REMAINING, 0, 0, G_OPTION_ARG_FILENAME_ARRAY, &uriArguments, nullptr, "[URL]" },
    6567    { nullptr, 0, 0, G_OPTION_ARG_NONE, nullptr, nullptr, nullptr }
     
    167169    }
    168170    g_option_context_free(context);
     171
     172    if (printVersion) {
     173        g_print("WPE WebKit %d.%d.%d\n",
     174            webkit_get_major_version(),
     175            webkit_get_minor_version(),
     176            webkit_get_micro_version());
     177        return 0;
     178    }
    169179
    170180    auto* loop = g_main_loop_new(nullptr, FALSE);
Note: See TracChangeset for help on using the changeset viewer.