diff options
| author | nsfisis <nsfisis@gmail.com> | 2026-06-06 18:04:45 +0900 |
|---|---|---|
| committer | nsfisis <nsfisis@gmail.com> | 2026-06-06 18:04:45 +0900 |
| commit | d5b313f388d424e60ae33ae58c1a65a65b24b8f1 (patch) | |
| tree | 849ada9b7319b8eb85aab28e02f614023fea2105 /crates/shirabe/src/command/bump_command.rs | |
| parent | 71b432db3f115d17be498f36cd3efd40b4650a0b (diff) | |
| download | php-shirabe-d5b313f388d424e60ae33ae58c1a65a65b24b8f1.tar.gz php-shirabe-d5b313f388d424e60ae33ae58c1a65a65b24b8f1.tar.zst php-shirabe-d5b313f388d424e60ae33ae58c1a65a65b24b8f1.zip | |
refactor(command): share Input/OutputInterface via Rc<RefCell>
Convert InputInterface and OutputInterface parameters from &dyn/&mut dyn
references to Rc<RefCell<dyn ...>> shared ownership across the command,
console, and IO layers, matching the Phase C shared-ownership approach
already used for IOInterface.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Diffstat (limited to 'crates/shirabe/src/command/bump_command.rs')
| -rw-r--r-- | crates/shirabe/src/command/bump_command.rs | 23 |
1 files changed, 18 insertions, 5 deletions
diff --git a/crates/shirabe/src/command/bump_command.rs b/crates/shirabe/src/command/bump_command.rs index d477747..ac207bc 100644 --- a/crates/shirabe/src/command/bump_command.rs +++ b/crates/shirabe/src/command/bump_command.rs @@ -57,10 +57,11 @@ impl BumpCommand { pub fn execute( &mut self, - input: &dyn InputInterface, - _output: &dyn OutputInterface, + input: std::rc::Rc<std::cell::RefCell<dyn InputInterface>>, + _output: std::rc::Rc<std::cell::RefCell<dyn OutputInterface>>, ) -> Result<i64> { let packages_filter: Vec<String> = input + .borrow() .get_argument("packages") .as_list() .map(|l| { @@ -70,9 +71,21 @@ impl BumpCommand { }) .unwrap_or_default(); - let dev_only = input.get_option("dev-only").as_bool().unwrap_or(false); - let no_dev_only = input.get_option("no-dev-only").as_bool().unwrap_or(false); - let dry_run = input.get_option("dry-run").as_bool().unwrap_or(false); + let dev_only = input + .borrow() + .get_option("dev-only") + .as_bool() + .unwrap_or(false); + let no_dev_only = input + .borrow() + .get_option("no-dev-only") + .as_bool() + .unwrap_or(false); + let dry_run = input + .borrow() + .get_option("dry-run") + .as_bool() + .unwrap_or(false); let io = self.get_io().clone(); self.do_bump( io, |
