X-Git-Url: https://git.wpitchoune.net/gitweb/?a=blobdiff_plain;f=src%2Ftw.c;h=ae670949f43181d1f7fe12e911edb9bb857c6312;hb=d2ffd5d71745fafa09e193ab9d32777b4ffbce49;hp=7ed0ae1cc975aa82f0c14b107d1504515b2e09a2;hpb=043d8c38ecd058ce89cfdce68ec173603ce538dd;p=ptask.git diff --git a/src/tw.c b/src/tw.c index 7ed0ae1..ae67094 100644 --- a/src/tw.c +++ b/src/tw.c @@ -86,7 +86,7 @@ static struct json_object *task_exec_json(char *opts) return NULL; } -struct task **get_all_tasks(const char *status) +struct task **tw_get_all_tasks(const char *status) { int i, n; struct json_object *jtasks, *jtask, *json; @@ -174,3 +174,44 @@ char *escape(const char *txt) return result; } +void tw_modify_description(const char *uuid, const char *newdesc) +{ + char *str; + char *opts; + + str = escape(newdesc); + + opts = malloc(1 + + strlen(uuid) + + strlen(" modify :\"") + + strlen(str) + + strlen("\"") + + 1); + sprintf(opts, " %s modify \"%s\"", uuid, str); + + task_exec(opts); + + free(str); + free(opts); +} + +void tw_modify_project(const char *uuid, const char *newproject) +{ + char *str; + char *opts; + + str = escape(newproject); + + opts = malloc(1 + + strlen(uuid) + + strlen(" modify project:\"") + + strlen(str) + + strlen("\"") + + 1); + sprintf(opts, " %s modify project:\"%s\"", uuid, str); + + task_exec(opts); + + free(str); + free(opts); +}