rdzobot 0.1.0

Modular, but monolithic Matrix bot
Documentation
// SPDX-License-Identifier: AGPL-3.0-or-later
// SPDX-FileCopyrightText: 2025 Wojtek Porczyk <woju@hackerspace.pl>

use clap::{
    Parser,
    ValueEnum,
};
use rdzobot::rcb::get_alert;

#[derive(Debug, Copy, Clone, ValueEnum)]
#[allow(non_camel_case_types)]
enum Subject {
    pis,
    rcb,
}

impl Subject {
    fn get_module_name(&self) -> &str {
        match self {
            Self::pis => "pis",
            Self::rcb => "rcb",
        }
    }
}

#[derive(Parser, Debug, Clone)]
#[command(version, about, long_about = None)]
struct Args {
    subject: Subject,
    template: Option<String>,
}

fn main() {
    let args = Args::parse();

    pyo3::prepare_freethreaded_python();
    println!(
        "{}",
        get_alert(args.subject.get_module_name(), args.template.as_deref()).unwrap()
    );
}