removed useless var
[ptask.git] / src / main.c
index 8dc69ba..fe98488 100644 (file)
@@ -45,6 +45,7 @@ static struct task **tasks;
 static struct option long_options[] = {
        {"version", no_argument, 0, 'v'},
        {"help", no_argument, 0, 'h'},
+       {"force-unsupported-taskwarrior", no_argument, 0, 'f'},
        {"debug", required_argument, 0, 'd'},
        {0, 0, 0, 0}
 };
@@ -74,7 +75,8 @@ static void print_help()
               "  -v, --version       display version information and exit"));
 
        puts("");
-
+       puts(_("  -f, --force-unsupported-taskwarrior force usage of an"
+              " unsupported version of taskwarrior"));
        puts(_("  -d, --debug=LEVEL   "
               "set the debug level, integer between 0 and 3"));
 
@@ -88,7 +90,7 @@ static void print_help()
 void refresh()
 {
        GtkWidget *dialog;
-       const char *current_prj, *current_uuid;
+       const char *current_uuid;
        struct task **old_tasks;
 
        log_fct_enter();
@@ -96,12 +98,10 @@ void refresh()
 
        if (tasks) {
                old_tasks = tasks;
-               current_prj = ui_projecttree_get_project();
                current_uuid = ui_tasktree_get_task_uuid();
                ui_tasktree_update(NULL);
        } else {
                old_tasks = NULL;
-               current_prj = NULL;
                current_uuid = NULL;
        }
 
@@ -119,7 +119,7 @@ void refresh()
                                                GTK_BUTTONS_CLOSE,
                                                _("Error loading tasks, verify "
                                                  "that a supported version of "
-                                                 "taskwarrior is installed "));
+                                                 "taskwarrior is installed."));
                gtk_dialog_run(GTK_DIALOG(dialog));
                gtk_widget_destroy(dialog);
        }
@@ -171,7 +171,7 @@ int main(int argc, char **argv)
 #endif
 
        cmdok = 1;
-       while ((optc = getopt_long(argc, argv, "vhd:", long_options,
+       while ((optc = getopt_long(argc, argv, "vhfd:", long_options,
                                   &opti)) != -1) {
                switch (optc) {
                case 'h':
@@ -184,6 +184,11 @@ int main(int argc, char **argv)
                        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;