#![allow(dead_code)]
#[derive(Debug, Clone)]
pub struct InfrastructureArgs {
pub action: InfrastructureAction,
pub services: Vec<String>,
}
#[derive(Debug, Clone, PartialEq)]
pub enum InfrastructureAction {
Start,
Stop,
Restart,
Status,
#[allow(dead_code)] Logs,
}
impl InfrastructureAction {
#[allow(dead_code)] pub fn parse(s: &str) -> Option<Self> {
match s {
"start" => Some(Self::Start),
"stop" => Some(Self::Stop),
"restart" => Some(Self::Restart),
"status" => Some(Self::Status),
"logs" => Some(Self::Logs),
_ => None,
}
}
#[allow(dead_code)] pub fn as_str(&self) -> &str {
match self {
Self::Start => "start",
Self::Stop => "stop",
Self::Restart => "restart",
Self::Status => "status",
Self::Logs => "logs",
}
}
}