From 7f14217abbba2f89ae5845d63c8f97b606354f45 Mon Sep 17 00:00:00 2001 From: nsfisis Date: Mon, 20 Jul 2026 05:55:46 +0900 Subject: fix(io): widen IOInterface::select choices to PhpMixed for assoc arrays PHP's IOInterface::select accepts an associative choices array whose keys are the selectable values, but the port narrowed it to Vec, making key-based selection unrepresentable. Accept PhpMixed (List or Array) like PHP's array $choices; ConsoleIO already branched on both shapes internally. Also mirror PHP in the single-select array_search fallback for numeric-keyed arrays. All call sites keep their previous list-based behavior. Co-Authored-By: Claude Fable 5 --- crates/shirabe/src/command/run_script_command.rs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'crates/shirabe/src/command/run_script_command.rs') diff --git a/crates/shirabe/src/command/run_script_command.rs b/crates/shirabe/src/command/run_script_command.rs index c256eea2..26e73d6d 100644 --- a/crates/shirabe/src/command/run_script_command.rs +++ b/crates/shirabe/src/command/run_script_command.rs @@ -209,7 +209,12 @@ impl Command for RunScriptCommand { let io = self.get_io(); let script = io.select( "Script to run: ".to_string(), - options.keys().cloned().collect(), + PhpMixed::List( + options + .keys() + .map(|k| PhpMixed::String(k.clone())) + .collect(), + ), PhpMixed::String(String::new()), PhpMixed::Int(1), "Invalid script name \"%s\"".to_string(), -- cgit v1.3.1