mecha10_cli/infrastructure/
types.rs

1//! Infrastructure types
2
3#![allow(dead_code)]
4
5/// Arguments for infrastructure command
6#[derive(Debug, Clone)]
7pub struct InfrastructureArgs {
8    pub action: InfrastructureAction,
9    pub services: Vec<String>,
10}
11
12/// Infrastructure action
13#[derive(Debug, Clone, PartialEq)]
14pub enum InfrastructureAction {
15    Start,
16    Stop,
17    Restart,
18    Status,
19    #[allow(dead_code)] // Handler exists, CLI command not yet implemented
20    Logs,
21}
22
23impl InfrastructureAction {
24    #[allow(dead_code)] // Planned for future use
25    pub fn parse(s: &str) -> Option<Self> {
26        match s {
27            "start" => Some(Self::Start),
28            "stop" => Some(Self::Stop),
29            "restart" => Some(Self::Restart),
30            "status" => Some(Self::Status),
31            "logs" => Some(Self::Logs),
32            _ => None,
33        }
34    }
35
36    #[allow(dead_code)] // Planned for future use
37    pub fn as_str(&self) -> &str {
38        match self {
39            Self::Start => "start",
40            Self::Stop => "stop",
41            Self::Restart => "restart",
42            Self::Status => "status",
43            Self::Logs => "logs",
44        }
45    }
46}