diff options
| author | nsfisis <nsfisis@gmail.com> | 2026-06-12 01:01:35 +0900 |
|---|---|---|
| committer | nsfisis <nsfisis@gmail.com> | 2026-06-12 01:01:43 +0900 |
| commit | 1e44f5723e4c0e0903d00a61f254901e612fe5e1 (patch) | |
| tree | 9c2e1eec364bbf6418a4072ee7767b04c3df0297 /crates/shirabe/src/command/run_script_command.rs | |
| parent | ddf0a624145b618c05c2ee47414545b99b685f37 (diff) | |
| download | php-shirabe-1e44f5723e4c0e0903d00a61f254901e612fe5e1.tar.gz php-shirabe-1e44f5723e4c0e0903d00a61f254901e612fe5e1.tar.zst php-shirabe-1e44f5723e4c0e0903d00a61f254901e612fe5e1.zip | |
feat(symfony-console): port Symfony Console and make the workspace compile
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Diffstat (limited to 'crates/shirabe/src/command/run_script_command.rs')
| -rw-r--r-- | crates/shirabe/src/command/run_script_command.rs | 25 |
1 files changed, 17 insertions, 8 deletions
diff --git a/crates/shirabe/src/command/run_script_command.rs b/crates/shirabe/src/command/run_script_command.rs index 9a28b5f..199dbab 100644 --- a/crates/shirabe/src/command/run_script_command.rs +++ b/crates/shirabe/src/command/run_script_command.rs @@ -123,8 +123,12 @@ impl RunScriptCommand { return Ok(()); } - if input.borrow().get_argument("script").as_string().is_some() - || input.borrow().get_option("list").as_bool().unwrap_or(false) + if input.borrow().get_argument("script")?.as_string().is_some() + || input + .borrow() + .get_option("list")? + .as_bool() + .unwrap_or(false) { return Ok(()); } @@ -154,11 +158,16 @@ impl RunScriptCommand { input: std::rc::Rc<std::cell::RefCell<dyn InputInterface>>, output: std::rc::Rc<std::cell::RefCell<dyn OutputInterface>>, ) -> Result<i64> { - if input.borrow().get_option("list").as_bool().unwrap_or(false) { + if input + .borrow() + .get_option("list")? + .as_bool() + .unwrap_or(false) + { return self.list_scripts(output); } - let script = match input.borrow().get_argument("script").as_string() { + let script = match input.borrow().get_argument("script")?.as_string() { None => { return Err(RuntimeException { message: "Missing required argument \"script\"".to_string(), @@ -184,10 +193,10 @@ impl RunScriptCommand { let dispatcher = crate::command::composer_full(&composer) .get_event_dispatcher() .clone(); - let dev_mode = input.borrow().get_option("dev").as_bool().unwrap_or(false) + let dev_mode = input.borrow().get_option("dev")?.as_bool().unwrap_or(false) || !input .borrow() - .get_option("no-dev") + .get_option("no-dev")? .as_bool() .unwrap_or(false); let io = self.get_io(); @@ -213,7 +222,7 @@ impl RunScriptCommand { let args: Vec<String> = input .borrow() - .get_argument("args") + .get_argument("args")? .as_list() .map(|l| { l.iter() @@ -222,7 +231,7 @@ impl RunScriptCommand { }) .unwrap_or_default(); - if let Some(timeout_val) = input.borrow().get_option("timeout").as_string() { + if let Some(timeout_val) = input.borrow().get_option("timeout")?.as_string() { let timeout_str = timeout_val.to_string(); if !timeout_str.chars().all(|c| c.is_ascii_digit()) { return Err(RuntimeException { |
