From 840ff9955a9597d13010d1e0056d1688edfde297 Mon Sep 17 00:00:00 2001 From: nsfisis Date: Tue, 12 May 2026 04:00:04 +0900 Subject: feat(port): port AboutCommand.php --- crates/shirabe/src/command/about_command.rs | 30 +++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) (limited to 'crates/shirabe/src/command/about_command.rs') diff --git a/crates/shirabe/src/command/about_command.rs b/crates/shirabe/src/command/about_command.rs index 7dfac3d..627a7f2 100644 --- a/crates/shirabe/src/command/about_command.rs +++ b/crates/shirabe/src/command/about_command.rs @@ -1 +1,31 @@ //! ref: composer/src/Composer/Command/AboutCommand.php + +use shirabe_external_packages::symfony::console::input::input_interface::InputInterface; +use shirabe_external_packages::symfony::console::output::output_interface::OutputInterface; +use crate::command::base_command::BaseCommand; +use crate::composer::Composer; + +pub struct AboutCommand { + inner: BaseCommand, +} + +impl AboutCommand { + pub fn configure(&mut self) { + self.inner + .set_name("about") + .set_description("Shows a short information about Composer") + .set_help("php composer.phar about"); + } + + pub fn execute(&self, input: &dyn InputInterface, output: &dyn OutputInterface) -> i64 { + let composer_version = Composer::get_version(); + + self.inner.get_io().write(&format!( + "Composer - Dependency Manager for PHP - version {composer_version}\n\ + Composer is a dependency manager tracking local dependencies of your projects and libraries.\n\ + See https://getcomposer.org/ for more information." + )); + + 0 + } +} -- cgit v1.3.1