/*
- * Copyright (C) 2012-2013 jeanfi@gmail.com
+ * Copyright (C) 2012-2016 jeanfi@gmail.com
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
#include <pstr.h>
#include "tw.h"
+/* Whether ptask check that the taskwarrior version is supported. */
+static int check_version_enabled = 1;
+
struct tm *parse_time(const char *t)
{
struct tm *tm;
if (!strcmp(ver, "2.2.0")
|| !strcmp(ver, "2.0.0")
- || !strcmp(ver, "2.3.0"))
+ || !strcmp(ver, "2.3.0")
+ || !strcmp(ver, "2.4.0")
+ || !strcmp(ver, "2.4.1")
+ || !strcmp(ver, "2.5.0"))
return 1;
else
return 0;
{
char *opts2;
- if (!task_check_version()) {
- log_err("ptask is not compatible with the installed version of"
- " taskwarrior.");
+ if (check_version_enabled && !task_check_version()) {
+ log_err("ptask is not compatible with the installed version of "
+ "taskwarrior. The command line option -f can force "
+ "the usage of an unsupported version of taskwarrior "
+ "(risk of malfunction like damaging data).");
return NULL;
}
free(cmd);
- if (o && is_error(o))
- return NULL;
-
return o;
}
return prjs;
}
+
+void tw_enable_check_version(int e)
+{
+ check_version_enabled = e;
+}