add subcomands for the current days

This commit is contained in:
Leo Drachenfeuer 2022-12-08 03:14:59 +01:00
parent d50a745a46
commit 27e7e0416a
Signed by: dragonleo
GPG key ID: A8338FC081137CF0

View file

@ -3,6 +3,11 @@ use clap::{arg, Parser, Subcommand};
use commands::day001::*;
use commands::day002::*;
use commands::day003::*;
use commands::day004::*;
use commands::day005::*;
use commands::day006::*;
use commands::day007::*;
use commands::day008::*;
//use std::ffi::OsString;
use std::path::PathBuf;
@ -44,6 +49,36 @@ pub enum Commands {
#[arg(long)]
alt: bool,
},
/// Solution for day 04
Day004 {
file: Option<PathBuf>,
#[arg(long)]
alt: bool,
},
/// Solution for day 05
Day005 {
file: Option<PathBuf>,
#[arg(long)]
alt: bool,
},
/// Solution for day 06
Day006 {
file: Option<PathBuf>,
#[arg(long)]
alt: bool,
},
/// Solution for day 07
Day007 {
file: Option<PathBuf>,
#[arg(long)]
alt: bool,
},
/// Solution for day 08
Day008 {
file: Option<PathBuf>,
#[arg(long)]
alt: bool,
},
}
pub fn execute_cli() {
@ -57,5 +92,10 @@ pub fn execute_cli() {
_ => panic!(),
},
Commands::Day003 { file, alt } => subcmd_day003(&file, &alt),
Commands::Day004 { file, alt } => subcmd_day004(&file, &alt),
Commands::Day005 { file, alt } => subcmd_day005(&file, &alt),
Commands::Day006 { file, alt } => subcmd_day006(&file, &alt),
Commands::Day007 { file, alt } => subcmd_day007(&file, &alt),
Commands::Day008 { file, alt } => subcmd_day008(&file, &alt)
}
}