diff options
| author | nsfisis <nsfisis@gmail.com> | 2026-07-05 19:27:56 +0900 |
|---|---|---|
| committer | nsfisis <nsfisis@gmail.com> | 2026-07-05 19:27:56 +0900 |
| commit | 325bb3ca3789843304424c7d552d0d3bb8d39ea2 (patch) | |
| tree | 7772f62eb8b82cbdbf8a228107f9bed3e5067408 /crates/shirabe/src/command/global_command.rs | |
| parent | 3f7865faae3eb93c5c258320ebfb99855cbdeb97 (diff) | |
| download | php-shirabe-325bb3ca3789843304424c7d552d0d3bb8d39ea2.tar.gz php-shirabe-325bb3ca3789843304424c7d552d0d3bb8d39ea2.tar.zst php-shirabe-325bb3ca3789843304424c7d552d0d3bb8d39ea2.zip | |
feat(global-command): wire resetComposer and Application::run proxying
Application::find/reset_composer and the shared ApplicationHandle are
now available, so GlobalCommand can reset the composer instance before
building the sub-command input and proxy execution through the full
Application::run dispatch, matching PHP's behavior. Un-ignores the
tests that only depended on this wiring, and re-points the remaining
ignores at their real (unrelated) blockers.
Diffstat (limited to 'crates/shirabe/src/command/global_command.rs')
| -rw-r--r-- | crates/shirabe/src/command/global_command.rs | 23 |
1 files changed, 17 insertions, 6 deletions
diff --git a/crates/shirabe/src/command/global_command.rs b/crates/shirabe/src/command/global_command.rs index 27331a7..b0a3542 100644 --- a/crates/shirabe/src/command/global_command.rs +++ b/crates/shirabe/src/command/global_command.rs @@ -3,6 +3,7 @@ use crate::command::BaseCommand; use crate::command::BaseCommandData; use crate::command::base_command::base_command_initialize; +use crate::console::Application; use crate::console::input::InputArgument; use crate::factory::Factory; use crate::util::Filesystem; @@ -106,8 +107,7 @@ impl GlobalCommand { &Self::input_to_string(&*input.borrow())?, 1, ); - // TODO(phase-c): getApplication()->resetComposer() needs the shared shirabe Application - // handle (deferred with the Application shared-ownership work). + self.reset_composer()?; StringInput::new(&new_input_str) } @@ -171,10 +171,21 @@ impl Command for GlobalCommand { } let sub_input = self.prepare_subcommand_input(input, false)?; - // TODO(phase-c): proxying to Application::run needs the shared shirabe Application handle - // (deferred with the Application shared-ownership work and command registration). - let _ = (sub_input, output); - todo!("global command proxy run pending shared Application handle") + let sub_input: Rc<RefCell<dyn InputInterface>> = Rc::new(RefCell::new(sub_input)); + + let application = { + let application = self + .get_application() + .expect("a proxy command is always attached to its application"); + let application = application.borrow(); + application + .as_any() + .downcast_ref::<Application>() + .expect("shirabe always installs its own Application") + .shared() + }; + + Ok(application.run(Some(sub_input), Some(output))? as i64) } fn initialize( |
