use crate::commands::Input;
use super::{ActionInvocation, ActionKind, ActionSpec, action_spec};
pub trait AbstractAction {
fn kind(&self) -> ActionKind;
fn spec(&self) -> &'static ActionSpec {
action_spec(self.kind()).expect("action spec must be registered")
}
fn handle(
&self,
inputs: Vec<Input>,
options: Vec<Input>,
extra_flags: Vec<String>,
) -> ActionInvocation {
ActionInvocation {
kind: self.kind(),
inputs,
options,
extra_flags,
}
}
}