aboutsummaryrefslogtreecommitdiffhomepage
path: root/crates/shirabe
diff options
context:
space:
mode:
authornsfisis <nsfisis@gmail.com>2026-06-05 05:53:30 +0900
committernsfisis <nsfisis@gmail.com>2026-06-05 05:53:30 +0900
commitb299a0c9b66523b9630b4cf6d3dca1509c3692b5 (patch)
tree3170e1bc32dff2ad7868671ef6c92b47c2569ef2 /crates/shirabe
parent7d3a88cb55f101f376a6635ea7dcbb0e10eff364 (diff)
downloadphp-shirabe-b299a0c9b66523b9630b4cf6d3dca1509c3692b5.tar.gz
php-shirabe-b299a0c9b66523b9630b4cf6d3dca1509c3692b5.tar.zst
php-shirabe-b299a0c9b66523b9630b4cf6d3dca1509c3692b5.zip
feat(command): wire do_execute for depends/prohibits commands
Forward execute() to BaseDependencyCommand::do_execute, mirroring the PHP commands that delegate to parent::doExecute (inverted=true for prohibits). Add the missing BaseDependencyCommand impl on DependsCommand. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Diffstat (limited to 'crates/shirabe')
-rw-r--r--crates/shirabe/src/command/depends_command.rs21
-rw-r--r--crates/shirabe/src/command/prohibits_command.rs10
2 files changed, 22 insertions, 9 deletions
diff --git a/crates/shirabe/src/command/depends_command.rs b/crates/shirabe/src/command/depends_command.rs
index 1e702e3..78b3dbb 100644
--- a/crates/shirabe/src/command/depends_command.rs
+++ b/crates/shirabe/src/command/depends_command.rs
@@ -65,11 +65,22 @@ impl DependsCommand {
);
}
- pub fn execute(&mut self, input: &dyn InputInterface, output: &dyn OutputInterface) -> i64 {
- // TODO(phase-b): wire `do_execute` from BaseDependencyCommand trait without conflicting with
- // BaseCommand blanket impl
- let _ = (input, output);
- todo!()
+ pub fn execute(
+ &mut self,
+ input: &dyn InputInterface,
+ output: &dyn OutputInterface,
+ ) -> anyhow::Result<i64> {
+ self.do_execute(input, output, false)
+ }
+}
+
+impl BaseDependencyCommand for DependsCommand {
+ fn colors(&self) -> &[String] {
+ &self.colors
+ }
+
+ fn colors_mut(&mut self) -> &mut Vec<String> {
+ &mut self.colors
}
}
diff --git a/crates/shirabe/src/command/prohibits_command.rs b/crates/shirabe/src/command/prohibits_command.rs
index 9b8132b..ff9328c 100644
--- a/crates/shirabe/src/command/prohibits_command.rs
+++ b/crates/shirabe/src/command/prohibits_command.rs
@@ -73,10 +73,12 @@ impl ProhibitsCommand {
);
}
- pub fn execute(&mut self, input: &dyn InputInterface, output: &dyn OutputInterface) -> i64 {
- // TODO(phase-b): wire `do_execute` from BaseDependencyCommand trait
- let _ = (input, output);
- todo!()
+ pub fn execute(
+ &mut self,
+ input: &dyn InputInterface,
+ output: &dyn OutputInterface,
+ ) -> anyhow::Result<i64> {
+ self.do_execute(input, output, true)
}
}