aboutsummaryrefslogtreecommitdiffhomepage
path: root/crates/shirabe/src/plugin/capability/command_provider.rs
blob: 2453860aa6434ef921da89b01b05e08aa2061aad (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
//! ref: composer/src/Composer/Plugin/Capability/CommandProvider.php

use crate::command::BaseCommand;
use crate::plugin::capability::Capability;

/// Commands Provider Interface. Plugins implementing this capability provide a list of
/// commands.
///
/// The sole implementor is the PHP capability proxy (Composer itself never implements a
/// capability), so the method is fallible: the answer crosses the RPC boundary.
pub trait CommandProvider: Capability {
    fn get_commands(&self) -> anyhow::Result<Vec<Box<dyn BaseCommand>>>;
}