【问题标题】:taskwarrior, delete old recurring taskstaskwarrior,删除旧的重复任务
【发布时间】:2014-09-05 09:56:22
【问题描述】:

如何删除 taskwarrior 中的所有重复任务,这些任务已完成,直到某个日期?

我试过了:

task Nevena until:07/29/2014 uuids

列出那些在该日期之前落下的人,并收集他们的 ID,这样我就可以通过管道将他们删除命令,但我没有得到预期的结果。

【问题讨论】:

    标签: taskwarrior


    【解决方案1】:

    我相信答案是删除父任务,然后将不再创建重复任务。您可以使用task all +PARENT 显示所有父任务。例如:

    $ task all +PARENT
    
    ID St UUID     Age  Done Tags R Due        Until Description                                     
    21 R  58e83c9b 1.7y           R 2018-04-01       replace upstairs air filter                     
    20 R  f8b5b0db 1.7y       [1] R 2018-04-01       replace upstairs air filter
    

    不知何故,我为同一件事重复了两个任务。我可以删除它们:

    $ task delete 21 
    Delete task 21 'replace upstairs air filter'? (yes/no) yes
    Deleting task 21 'replace upstairs air filter'.
    Deleted 1 task.
    $
    $ task delete 20
    Delete task 20 'replace upstairs air filter'? (yes/no) yes
    Deleting task 20 'replace upstairs air filter'.
    Deleted 1 task.
    

    现在重复任务应该不会再显示了。

    【讨论】:

      【解决方案2】:

      拉了一会儿头发后,我找到了答案(警告:此命令也可能删除不重复的任务):

      task $(task uuids due.before:now) delete
      

      成功了。

      这行得通,因为无论日期是什么,已完成的任务在未来都没有截止日期,所以这个命令让我当前的新任务保持不变。

      【讨论】:

      • 警告:此命令还可能删除不重复的任务
      • 我发现使用grep " mask:" ~/.task/pending.data手动获取 UUID 更安全
      【解决方案3】:

      命令

      task $(task uuids due.before:now +CHILD +COMPLETED) delete
      

      应该做你想做的事。

      根据@branquito 的回答。

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 2021-01-20
        • 2017-01-16
        • 1970-01-01
        • 2020-02-17
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多