Added Arguments

This commit is contained in:
2024-01-21 12:37:43 +01:00
parent 4ef959f673
commit 114a1accde
4 changed files with 223 additions and 15 deletions
+22
View File
@@ -0,0 +1,22 @@
use clap::Parser;
#[derive(Parser, Default, Debug)]
#[clap(
author = "Mathias Rothenhäusler",
version,
about = "Start RCC local test environment."
)]
pub struct Arguments {
#[arg(help = "Possible values are 'up' and 'down'")]
pub action: String,
}
impl Arguments {
pub fn validate(&self) -> Result<(), Box<dyn std::error::Error>> {
if self.action == "up" || self.action == "down" {
return Ok(());
}
Err("Action values are up or down.".into())
}
}