aboutsummaryrefslogtreecommitdiffhomepage
path: root/crates/shirabe/src/command/remove_command.rs
diff options
context:
space:
mode:
Diffstat (limited to 'crates/shirabe/src/command/remove_command.rs')
-rw-r--r--crates/shirabe/src/command/remove_command.rs15
1 files changed, 12 insertions, 3 deletions
diff --git a/crates/shirabe/src/command/remove_command.rs b/crates/shirabe/src/command/remove_command.rs
index ebd332a8..4eb4308a 100644
--- a/crates/shirabe/src/command/remove_command.rs
+++ b/crates/shirabe/src/command/remove_command.rs
@@ -1,6 +1,7 @@
//! ref: composer/src/Composer/Command/RemoveCommand.php
use crate::advisory::Auditor;
+use crate::command::CompletionTrait;
use crate::command::base_command::base_command_initialize;
use crate::command::{BaseCommand, BaseCommandData};
use crate::config::ConfigSourceInterface;
@@ -47,15 +48,15 @@ impl RemoveCommand {
impl Command for RemoveCommand {
fn configure(&self) -> anyhow::Result<()> {
- // TODO(cli-completion): suggest_root_requirement() for `packages` argument
self.set_name("remove")?;
self.set_aliases(vec!["rm".to_string(), "uninstall".to_string()])?;
self.set_description("Removes a package from the require or require-dev");
self.set_definition(&[
- InputArgument::new("packages",
+ InputArgument::new5("packages",
Some(InputArgument::IS_ARRAY),
"Packages that should be removed.",
- None).unwrap().into(),
+ None,
+ self.suggest_root_requirement()).unwrap().into(),
InputOption::new("dev",
None,
Some(InputOption::VALUE_NONE),
@@ -711,6 +712,14 @@ impl Command for RemoveCommand {
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\\RemoveCommand"