Add cli arguments

This commit is contained in:
2022-11-17 22:33:14 +01:00
parent 139fd6a5a9
commit 4d5917b21f
5 changed files with 222 additions and 13 deletions

30
src/cli.rs Normal file
View File

@@ -0,0 +1,30 @@
use clap::Parser;
/// tuemensa is a simple cli tool to retrieve the current meal plan.
#[derive(Parser, Debug)]
#[command(author, version, about, long_about = None)]
pub struct Args {
/// Show Mensa Morgenstelle
#[arg(short, long, default_value_t = false)]
pub morgenstelle: bool,
/// Show Mensa Shedhalle
#[arg(short, long, default_value_t = false)]
pub shedhalle: bool,
/// Format as plain text
#[arg(short, long, default_value_t = false)]
pub plaintext: bool,
/// Use very short format (oneline)
#[arg(short, long, default_value_t = false)]
pub oneline: bool,
/// Offset of days in the future (valid inputs 0-7)
#[arg(short, long, default_value_t = 0)]
pub days: u8,
}
pub fn get_args() -> Args {
Args::parse()
}