Skip to main content

cli/commands/
add_command.rs

1//! Upstream source: `../nest-cli/commands/add.command.ts`.
2
3use crate::actions::ActionKind;
4
5use super::abstract_command::AbstractCommand;
6use super::{CommandName, CommandSpec, command_spec};
7
8/// Typed wrapper for upstream `AddCommand`.
9#[derive(Clone, Copy, Debug, Default, PartialEq, Eq)]
10pub struct AddCommand;
11
12impl AddCommand {
13    pub const fn new() -> Self {
14        Self
15    }
16
17    pub fn spec(&self) -> &'static CommandSpec {
18        command_spec(CommandName::Add).expect("add command spec")
19    }
20
21    pub const fn action_kind(&self) -> ActionKind {
22        ActionKind::Add
23    }
24}
25
26impl AbstractCommand for AddCommand {
27    fn command_name(&self) -> CommandName {
28        CommandName::Add
29    }
30}