Skip to content

Commit

Permalink
Rust scheduler: Add CLI
Browse files Browse the repository at this point in the history
CMK-14516
  • Loading branch information
jherbel committed Sep 18, 2023
1 parent 09d1134 commit a1db442
Show file tree
Hide file tree
Showing 4 changed files with 237 additions and 0 deletions.
214 changes: 214 additions & 0 deletions v2/rust/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions v2/rust/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,4 @@ edition = "2021"

[dependencies]
anyhow = { version = "*", features = ["backtrace"] }
clap = { version = "*", features = ["derive"] }
19 changes: 19 additions & 0 deletions v2/rust/src/cli.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
use clap::{ArgAction, Parser};
use std::path::PathBuf;

#[derive(Parser)]
#[command(about = "Robotmk suite scheduler.")]
pub struct Args {
/// Configuration file path.
#[arg(name = "CONFIG_PATH")]
pub config_path: PathBuf,

/// Log file path. If left unspecified, the program will log to standard error.
#[arg(long, name = "LOG_PATH")]
pub log_path: Option<PathBuf>,

/// Enable verbose output. Use once (-v) for logging level INFO and twice (-vv) for logging
/// level DEBUG.
#[arg(short, long, action = ArgAction::Count)]
pub verbose: u8,
}
3 changes: 3 additions & 0 deletions v2/rust/src/main.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
#![allow(dead_code)]
pub mod attempt;
mod cli;
use clap::Parser;

fn main() -> anyhow::Result<()> {
let _args = cli::Args::parse();
Ok(())
}

0 comments on commit a1db442

Please sign in to comment.