+ int optc, cmdok, opti, ret;
+ GError *err;
+ gchar *msg;
+ GtkMessageDialog *diag;
+
+ program_name = argv[0];
+
+ setlocale(LC_ALL, "");
+
+#if ENABLE_NLS
+ bindtextdomain(PACKAGE, LOCALEDIR);
+ textdomain(PACKAGE);
+#endif
+
+ cmdok = 1;
+ while ((optc = getopt_long(argc, argv, "vhfd:", long_options,
+ &opti)) != -1) {
+ switch (optc) {
+ case 'h':
+ print_help();
+ exit(EXIT_SUCCESS);
+ case 'v':
+ print_version();
+ exit(EXIT_SUCCESS);
+ case 'd':
+ log_level = atoi(optarg);
+ log_info(_("Enables debug mode."));
+ break;
+ case 'f':
+ log_info(_("Force usage of an unsupported version of "
+ "taskwarrior."));
+ tw_enable_check_version(0);
+ break;
+ default:
+ cmdok = 0;
+ break;
+ }
+ }
+
+ if (!cmdok || optind != argc) {
+ fprintf(stderr, _("Try `%s --help' for more information.\n"),
+ program_name);
+ exit(EXIT_FAILURE);
+ }
+
+ log_init();