summaryrefslogtreecommitdiffstats
path: root/src/tools/shell.rs
diff options
context:
space:
mode:
authorsalmonik <salmon@2137697.xyz>2026-11-22 18:58:26 +0100
committersalmonik <salmon@2137697.xyz>2026-11-22 18:58:26 +0100
commit7c035acc6e282cdbaa3b0060a528660fa0dba0d4 (patch)
tree0998222677041f58b2759adc99d3515b8db2d404 /src/tools/shell.rs
parent0.12.0: provider is a type + URL, plus a config file (diff)
downloadagent686-7c035acc6e282cdbaa3b0060a528660fa0dba0d4.tar.gz
agent686-7c035acc6e282cdbaa3b0060a528660fa0dba0d4.zip
0.12.1: accept `command` as an alias for `cmd` in bash
A field report showed ~40% of bash calls died on a one-word slip (command vs cmd); the alias removes the failure class instead of improving the error for it.
Diffstat (limited to '')
-rw-r--r--src/tools/shell.rs6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/tools/shell.rs b/src/tools/shell.rs
index c38f032..c64bab3 100644
--- a/src/tools/shell.rs
+++ b/src/tools/shell.rs
@@ -37,7 +37,11 @@ pub fn bash(
37 timeout: Duration, 37 timeout: Duration,
38 cancel: &AtomicBool, 38 cancel: &AtomicBool,
39) -> Result<String, String> { 39) -> Result<String, String> {
40 let cmd = match args.get("cmd").and_then(|v| v.as_str()) { 40 let cmd = match args
41 .get("cmd")
42 .or_else(|| args.get("command"))
43 .and_then(|v| v.as_str())
44 {
41 Some(cmd) => cmd.to_string(), 45 Some(cmd) => cmd.to_string(),
42 None => return Err("missing required argument `cmd`".into()), 46 None => return Err("missing required argument `cmd`".into()),
43 }; 47 };