projects
/
ptask.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
added support of taskwarrior 2.5
[ptask.git]
/
src
/
tw.c
diff --git
a/src/tw.c
b/src/tw.c
index
db731e9
..
a32ec1c
100644
(file)
--- a/
src/tw.c
+++ b/
src/tw.c
@@
-31,6
+31,9
@@
#include <pstr.h>
#include "tw.h"
#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;
struct tm *parse_time(const char *t)
{
struct tm *tm;
@@
-110,7
+113,10
@@
static int task_check_version()
if (!strcmp(ver, "2.2.0")
|| !strcmp(ver, "2.0.0")
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;
return 1;
else
return 0;
@@
-120,9
+126,11
@@
static char *tw_exec(char *opts)
{
char *opts2;
{
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;
}
return NULL;
}
@@
-646,3
+654,8
@@
struct project **tw_get_projects(struct task **tasks)
return prjs;
}
return prjs;
}
+
+void tw_enable_check_version(int e)
+{
+ check_version_enabled = e;
+}