2022-08-16 23:40:42 +02:00
|
|
|
use clap::Parser;
|
|
|
|
|
2022-08-16 10:32:46 +02:00
|
|
|
mod ics;
|
2022-08-16 10:41:42 +02:00
|
|
|
mod info;
|
2022-08-15 14:52:57 +02:00
|
|
|
mod timetable;
|
2022-08-16 15:48:13 +02:00
|
|
|
mod utils;
|
2022-08-12 21:20:39 +02:00
|
|
|
|
2022-08-16 23:40:42 +02:00
|
|
|
#[derive(Parser)]
|
|
|
|
#[clap(version, about, long_about = None)]
|
|
|
|
struct Args {
|
|
|
|
/// Class
|
|
|
|
#[clap(short, long, value_parser)]
|
|
|
|
class: i8,
|
|
|
|
|
|
|
|
/// Subgroup if you have one, for example in `L1-A`, specify here the `A`
|
|
|
|
#[clap(short, long, value_parser)]
|
|
|
|
letter: Option<char>,
|
|
|
|
}
|
|
|
|
|
2022-08-12 19:55:28 +02:00
|
|
|
#[tokio::main]
|
2022-08-14 12:44:36 +02:00
|
|
|
async fn main() {
|
2022-08-16 23:40:42 +02:00
|
|
|
let args = Args::parse();
|
|
|
|
|
|
|
|
println!("class: L{}{}", args.class, args.letter.unwrap_or_default());
|
|
|
|
|
|
|
|
/* println!("Fetch the timetable...");
|
2022-08-15 19:20:10 +02:00
|
|
|
let timetable = timetable::timetable(3, 1, None).await;
|
2022-08-12 21:20:39 +02:00
|
|
|
|
2022-08-16 15:48:13 +02:00
|
|
|
println!("Fetch informations about the year...");
|
2022-08-15 19:20:10 +02:00
|
|
|
let info = info::info().await;
|
|
|
|
|
2022-08-16 15:48:13 +02:00
|
|
|
println!("Build the ICS file...");
|
2022-08-16 10:41:42 +02:00
|
|
|
let builded_timetable = timetable::build(timetable, info);
|
|
|
|
|
2022-08-16 23:40:42 +02:00
|
|
|
ics::export(builded_timetable, "target/debug.ics"); */
|
2022-08-14 12:44:36 +02:00
|
|
|
}
|