mirror of
https://github.com/GothenburgBitFactory/taskshell.git
synced 2025-06-26 10:54:29 +02:00
Review: Added local confirmation befor modifying Taskwarrior configuration
This commit is contained in:
parent
0f13520551
commit
3695e3619e
1 changed files with 14 additions and 8 deletions
|
@ -249,20 +249,26 @@ int cmdReview (const std::vector <std::string>& args)
|
|||
auto status = execute ("task", {"_get", "rc.uda.reviewed.type"}, input, output);
|
||||
if (status || output != "date\n")
|
||||
{
|
||||
execute ("task", {"rc.confirmation:no", "rc.verbose:nothing", "config", "uda.reviewed.type", "date"}, input, output);
|
||||
execute ("task", {"rc.confirmation:no", "rc.verbose:nothing", "config", "uda.reviewed.label", "Reviewed"}, input, output);
|
||||
if (confirm ("Tasksh needs to define a 'reviewed' UDA of type 'date' for all tasks. Ok to proceed?"))
|
||||
{
|
||||
execute ("task", {"rc.confirmation:no", "rc.verbose:nothing", "config", "uda.reviewed.type", "date"}, input, output);
|
||||
execute ("task", {"rc.confirmation:no", "rc.verbose:nothing", "config", "uda.reviewed.label", "Reviewed"}, input, output);
|
||||
}
|
||||
}
|
||||
|
||||
// Configure '_reviewed' report, but only if necessary.
|
||||
status = execute ("task", {"_get", "rc.report._reviewed.columns"}, input, output);
|
||||
if (status || output != "uuid\n")
|
||||
{
|
||||
execute ("task", {"rc.confirmation:no", "rc.verbose:nothing", "config", "report._reviewed.description",
|
||||
"Tasksh review report. Adjust the filter to your needs." }, input, output);
|
||||
execute ("task", {"rc.confirmation:no", "rc.verbose:nothing", "config", "report._reviewed.columns", "uuid" }, input, output);
|
||||
execute ("task", {"rc.confirmation:no", "rc.verbose:nothing", "config", "report._reviewed.sort", "reviewed+,modified+"}, input, output);
|
||||
execute ("task", {"rc.confirmation:no", "rc.verbose:nothing", "config", "report._reviewed.filter",
|
||||
"( reviewed.none: or reviewed.before:now-1week ) and ( +PENDING or +WAITING )" }, input, output);
|
||||
if (confirm ("Tasksh needs to define a '_reviewed' report to identify tasks needing review. Ok to proceed?"))
|
||||
{
|
||||
execute ("task", {"rc.confirmation:no", "rc.verbose:nothing", "config", "report._reviewed.description",
|
||||
"Tasksh review report. Adjust the filter to your needs." }, input, output);
|
||||
execute ("task", {"rc.confirmation:no", "rc.verbose:nothing", "config", "report._reviewed.columns", "uuid" }, input, output);
|
||||
execute ("task", {"rc.confirmation:no", "rc.verbose:nothing", "config", "report._reviewed.sort", "reviewed+,modified+"}, input, output);
|
||||
execute ("task", {"rc.confirmation:no", "rc.verbose:nothing", "config", "report._reviewed.filter",
|
||||
"( reviewed.none: or reviewed.before:now-1week ) and ( +PENDING or +WAITING )" }, input, output);
|
||||
}
|
||||
}
|
||||
|
||||
// Obtain a list of UUIDs to review.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue