25 lines
630 B
Rust
25 lines
630 B
Rust
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,
|
|
#[arg(help = "Which project folder to use, defined in your env file. E.g. xxx_DIR.")]
|
|
pub project: 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())
|
|
}
|
|
}
|