From 067252c91aea11045589795e4a98c8d6032e3356 Mon Sep 17 00:00:00 2001 From: nsfisis Date: Mon, 20 Jul 2026 05:56:10 +0900 Subject: fix(run-script-command): pass script choices as assoc array in interact PHP's RunScriptCommand::interact passes $options keyed by script name, so select resolves the entered value to the script name and sets it as the script argument. The port passed only the keys as a list, which made select resolve to a numeric index instead of the script name. Co-Authored-By: Claude Fable 5 --- crates/shirabe/src/command/run_script_command.rs | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) (limited to 'crates/shirabe/src/command') diff --git a/crates/shirabe/src/command/run_script_command.rs b/crates/shirabe/src/command/run_script_command.rs index 26e73d6d..faa3a6dd 100644 --- a/crates/shirabe/src/command/run_script_command.rs +++ b/crates/shirabe/src/command/run_script_command.rs @@ -203,18 +203,13 @@ impl Command for RunScriptCommand { let mut options = indexmap::IndexMap::new(); for script in &scripts { - options.insert(script.0.clone(), script.1.clone()); + options.insert(script.0.clone(), PhpMixed::String(script.1.clone())); } let io = self.get_io(); let script = io.select( "Script to run: ".to_string(), - PhpMixed::List( - options - .keys() - .map(|k| PhpMixed::String(k.clone())) - .collect(), - ), + PhpMixed::Array(options), PhpMixed::String(String::new()), PhpMixed::Int(1), "Invalid script name \"%s\"".to_string(), -- cgit v1.3.1