aboutsummaryrefslogtreecommitdiffhomepage
path: root/crates/shirabe/src/command/suggests_command.rs
diff options
context:
space:
mode:
Diffstat (limited to 'crates/shirabe/src/command/suggests_command.rs')
-rw-r--r--crates/shirabe/src/command/suggests_command.rs13
1 files changed, 11 insertions, 2 deletions
diff --git a/crates/shirabe/src/command/suggests_command.rs b/crates/shirabe/src/command/suggests_command.rs
index fc2b739a..65493f2f 100644
--- a/crates/shirabe/src/command/suggests_command.rs
+++ b/crates/shirabe/src/command/suggests_command.rs
@@ -1,5 +1,6 @@
//! ref: composer/src/Composer/Command/SuggestsCommand.php
+use crate::command::CompletionTrait;
use crate::command::base_command::base_command_initialize;
use crate::command::{BaseCommand, BaseCommandData};
use crate::console::input::InputArgument;
@@ -41,7 +42,6 @@ impl SuggestsCommand {
impl Command for SuggestsCommand {
fn configure(&self) -> anyhow::Result<()> {
- // TODO(cli-completion): suggest_installed_package() for `packages` argument
self.set_name("suggests")?;
self.set_description("Shows package suggestions");
self.set_definition(&[
@@ -90,11 +90,12 @@ impl Command for SuggestsCommand {
)
.unwrap()
.into(),
- InputArgument::new(
+ InputArgument::new5(
"packages",
Some(InputArgument::IS_ARRAY | InputArgument::OPTIONAL),
"Packages that you want to list suggestions from.",
None,
+ self.suggest_installed_package(true, false),
)
.unwrap()
.into(),
@@ -219,6 +220,14 @@ impl Command for SuggestsCommand {
base_command_initialize(self, input, output)
}
+ fn complete(
+ &self,
+ input: &shirabe_external_packages::symfony::console::completion::completion_input::CompletionInput,
+ suggestions: &mut shirabe_external_packages::symfony::console::completion::completion_suggestions::CompletionSuggestions,
+ ) -> anyhow::Result<()> {
+ crate::command::base_command::base_command_complete(self, input, suggestions)
+ }
+
shirabe_external_packages::delegate_command_trait_impls_to_inner!(
base_command_data,
"Composer\\Command\\SuggestsCommand"