aboutsummaryrefslogtreecommitdiffhomepage
path: root/crates/shirabe/src/console
diff options
context:
space:
mode:
Diffstat (limited to 'crates/shirabe/src/console')
-rw-r--r--crates/shirabe/src/console/application.rs8
1 files changed, 8 insertions, 0 deletions
diff --git a/crates/shirabe/src/console/application.rs b/crates/shirabe/src/console/application.rs
index 4f7754d..7fa6720 100644
--- a/crates/shirabe/src/console/application.rs
+++ b/crates/shirabe/src/console/application.rs
@@ -246,6 +246,14 @@ impl Application {
Ok(application)
}
+ /// Returns the shared handle to this application set up by `new_shared`. Proxy commands use it to
+ /// re-enter the run flow (PHP's `$this->getApplication()->run(...)`).
+ pub fn shared(&self) -> std::rc::Rc<std::cell::RefCell<Application>> {
+ self.me
+ .upgrade()
+ .expect("Application must be constructed through new_shared")
+ }
+
/// Registers the default commands on a shared application (PHP's lazy `init()`), executed once
/// with no application borrow held so each `set_application` can borrow back safely.
fn init_shared(