[英]taskwarrior "task del" without confirmation dialog
In taskwarrior there are some commands which need confirmirmation, like deleting more than 2 tasks or modify recurring tasks.在 taskwarrior 中有一些命令需要确认,比如删除超过 2 个任务或修改重复任务。 I don't want to confirm every time and I have already set "confirmation off" in file.taskrc.
我不想每次都确认,我已经在 file.taskrc 中设置了“确认关闭”。
I'm using the subprocess module in python to invoke taskwarrior commands.我正在使用 python 中的子进程模块来调用 taskwarrior 命令。 I'm calling for example
task del 1,2,3
and the shell waits now for a manual confirmation of the deletion request.例如,我正在调用
task del 1,2,3
,而 shell 现在正在等待手动确认删除请求。
How can I avoid the manual confirmation?如何避免手动确认?
You should add confirmation=no
to ~/.taskrc
. 你应该在
~/.taskrc
添加confirmation=no
。
Here's a one-liner to do that: 这是一个单行代码:
echo confirmation=no >> ~/.taskrc
already added confirmation=no
to ~/.taskrc
已添加
confirmation=no
~/.taskrc
a possible answer to the question could be 问题的可能答案可能是
echo 'all' | task del 1,2,3
but there could be a better one 但可能会有一个更好的
To disable confirmations entirely, I have the following in my taskrc
:要完全禁用确认,我的
taskrc
中有以下内容:
# no confirmation on bulk actions
confirmation=off
bulk=0
This command will remove tasks 1
, 2
and 3
without asking for confirmation:此命令将删除任务
1
、 2
和3
而不要求确认:
$ task rc.bulk=0 rc.confirmation=off 1-3 delete
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.