Added Arguments
This commit is contained in:
@@ -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())
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user