diff options
| author | nsfisis <nsfisis@gmail.com> | 2026-05-12 04:00:04 +0900 |
|---|---|---|
| committer | nsfisis <nsfisis@gmail.com> | 2026-05-12 04:00:04 +0900 |
| commit | 840ff9955a9597d13010d1e0056d1688edfde297 (patch) | |
| tree | ee609bc4744c8e101f41b0edc86c5251057d6bfc /crates/shirabe | |
| parent | db5a0d25d8bdb959a5796535dc450f020c5dd3c8 (diff) | |
| download | php-shirabe-840ff9955a9597d13010d1e0056d1688edfde297.tar.gz php-shirabe-840ff9955a9597d13010d1e0056d1688edfde297.tar.zst php-shirabe-840ff9955a9597d13010d1e0056d1688edfde297.zip | |
feat(port): port AboutCommand.php
Diffstat (limited to 'crates/shirabe')
| -rw-r--r-- | crates/shirabe/src/command/about_command.rs | 30 |
1 files changed, 30 insertions, 0 deletions
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("<info>php composer.phar about</info>"); + } + + pub fn execute(&self, input: &dyn InputInterface, output: &dyn OutputInterface) -> i64 { + let composer_version = Composer::get_version(); + + self.inner.get_io().write(&format!( + "<info>Composer - Dependency Manager for PHP - version {composer_version}</info>\n\ + <comment>Composer is a dependency manager tracking local dependencies of your projects and libraries.\n\ + See https://getcomposer.org/ for more information.</comment>" + )); + + 0 + } +} |
