/*
* Application entry point
*
* Copyright (C) 2017 Patrick McDermott
*
* This file is part of Marquee.
*
* Marquee is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Marquee is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with Marquee. If not, see .
*/
#ifdef HAVE_CONFIG_H
#include
#endif
#include
#include
#include "main-window.h"
static gchar *opt_profile;
static gboolean opt_private;
static gboolean opt_version;
static GOptionEntry entries[] = {
{"profile", 'P', G_OPTION_FLAG_NONE, G_OPTION_ARG_STRING,
&opt_profile,
"Load configuration and browsing data from PROFILE",
"PROFILE"},
{"private", 'p', G_OPTION_FLAG_NONE, G_OPTION_ARG_NONE,
&opt_private,
"Browse privately, without saving browsing data",
NULL},
{"version", 'V', G_OPTION_FLAG_NONE, G_OPTION_ARG_NONE,
&opt_version,
"Show application version",
NULL},
{NULL}
};
int
main(int argc, char *argv[])
{
GError *error;
if (G_UNLIKELY(!gtk_init_with_args(&argc, &argv, "[URI]", entries, NULL,
&error))) {
g_print("%s: %s\n", PACKAGE, error->message);
return EXIT_FAILURE;
}
if (G_UNLIKELY(opt_version)) {
g_print("%s %s\n", PACKAGE_NAME, PACKAGE_VERSION);
g_print("Copyright (C) %s %s\n", "2017", "Patrick McDermott");
g_print("License GPLv3+: GNU GPL version 3 or later "
".\n"
"This is free software: you are free to change and "
"redistribute it.\n"
"There is NO WARRANTY, to the extent permitted by "
"law.\n\n");
g_print("Please report bugs to <%s>.\n", PACKAGE_BUGREPORT);
return EXIT_SUCCESS;
}
mq_main_window_new();
gtk_main();
return EXIT_SUCCESS;
}