Compare commits
No commits in common. "47d7d81f60b107e7b7e2a60c3fab4a90cf702c6b" and "5cc9ebe989cb754917c5cc3660deda8b6864ab0a" have entirely different histories.
47d7d81f60
...
5cc9ebe989
|
@ -2,6 +2,6 @@ use std::path::Path;
|
|||
|
||||
use crate::util;
|
||||
|
||||
pub fn grade(verbosity: u8, config: util::config::Config, grade_config: Option<&Path>, threads: u8) {
|
||||
pub fn grade(verbosity: u8, config: util::config::Config, grade_config: Option<&Path>) {
|
||||
println!("Grading!");
|
||||
}
|
||||
|
|
19
src/main.rs
19
src/main.rs
|
@ -13,7 +13,6 @@ fn main() {
|
|||
|
||||
// parse the verbosity and eliminate the Option<>
|
||||
let verbosity = get_verbosity(cli.verbosity);
|
||||
let threads = get_threads(cli.threads);
|
||||
let config = util::config::parse_config(cli.config_file);
|
||||
|
||||
//parse the config file
|
||||
|
@ -21,8 +20,8 @@ fn main() {
|
|||
|
||||
match &cli.command {
|
||||
Command::Validate => validate::validate(verbosity, config),
|
||||
Command::Run => run::run(verbosity, config, threads),
|
||||
Command::Grade => grade::grade(verbosity, config, cli.grading_conf.as_deref(), threads),
|
||||
Command::Run => run::run(verbosity, config),
|
||||
Command::Grade => grade::grade(verbosity, config, cli.grading_conf.as_deref()),
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -34,9 +33,7 @@ struct Cli {
|
|||
#[arg(short, long, action = clap::ArgAction::Count)]
|
||||
verbosity: Option<u8>,
|
||||
|
||||
/// Set the number of threads (only valid in run and grade mode)
|
||||
#[arg(short, long)]
|
||||
threads: Option<u8>,
|
||||
//TODO implement a thread count variable for the runner
|
||||
|
||||
/// Set the config file
|
||||
#[arg(short, long, value_name = "CONFIG")]
|
||||
|
@ -79,13 +76,3 @@ fn get_verbosity(verb: Option<u8>) -> u8 {
|
|||
|
||||
return verbosity;
|
||||
}
|
||||
|
||||
fn get_threads(threads: Option<u8>) -> u8 {
|
||||
let thr: u8;
|
||||
match threads {
|
||||
Some(x) => thr = x,
|
||||
None => thr = 1,
|
||||
}
|
||||
|
||||
return thr;
|
||||
}
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
use crate::util;
|
||||
|
||||
pub fn run(verbosity: u8, config: util::config::Config, threads: u8) {
|
||||
pub fn run(verbosity: u8, config: util::config::Config) {
|
||||
println!("Running!");
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue