aboutsummaryrefslogtreecommitdiffstats
path: root/src/tools/mod.rs
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/tools/mod.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/tools/mod.rs b/src/tools/mod.rs
index 7a1a26d..a8851ab 100644
--- a/src/tools/mod.rs
+++ b/src/tools/mod.rs
@@ -25,12 +25,12 @@ pub fn approval(name: &str) -> Approval {
25} 25}
26 26
27/// Tools that execute immediately. 27/// Tools that execute immediately.
28pub fn run(name: &str, args: &Value) -> Result<String, String> { 28pub fn run(name: &str, args: &Value, cancel: &std::sync::atomic::AtomicBool) -> Result<String, String> {
29 match name { 29 match name {
30 "read" => fs::read(args), 30 "read" => fs::read(args),
31 "grep" => fs::grep(args), 31 "grep" => fs::grep(args),
32 "glob" => fs::glob(args), 32 "glob" => fs::glob(args),
33 "bash" => shell::bash(args, std::time::Duration::from_secs(120)), 33 "bash" => shell::bash(args, std::time::Duration::from_secs(120), cancel),
34 other => Err(unknown(other)), 34 other => Err(unknown(other)),
35 } 35 }
36} 36}