diff options
| author | nsfisis <nsfisis@gmail.com> | 2026-07-20 05:56:10 +0900 |
|---|---|---|
| committer | nsfisis <nsfisis@gmail.com> | 2026-07-20 05:56:10 +0900 |
| commit | 067252c91aea11045589795e4a98c8d6032e3356 (patch) | |
| tree | 77f44986c25c7dbf05f34c11e6e11e07bb0c761a /crates/shirabe/src/command | |
| parent | 7f14217abbba2f89ae5845d63c8f97b606354f45 (diff) | |
| download | php-shirabe-067252c91aea11045589795e4a98c8d6032e3356.tar.gz php-shirabe-067252c91aea11045589795e4a98c8d6032e3356.tar.zst php-shirabe-067252c91aea11045589795e4a98c8d6032e3356.zip | |
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 <noreply@anthropic.com>
Diffstat (limited to 'crates/shirabe/src/command')
| -rw-r--r-- | crates/shirabe/src/command/run_script_command.rs | 9 |
1 files changed, 2 insertions, 7 deletions
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(), |
