2025-04-28 19:02:32 -04:00
|
|
|
//! CLI parameters
|
|
|
|
|
|
2025-12-28 21:20:16 -03:00
|
|
|
use std::str::FromStr;
|
|
|
|
|
|
2025-12-27 01:48:17 -03:00
|
|
|
use clap::{Parser, Subcommand};
|
2025-04-28 19:02:32 -04:00
|
|
|
|
2025-12-28 21:20:16 -03:00
|
|
|
use crate::lang::Language;
|
|
|
|
|
|
2025-04-28 19:02:32 -04:00
|
|
|
#[derive(Debug, Parser)]
|
|
|
|
|
#[command(version, about, long_about = None)]
|
|
|
|
|
pub struct Args {
|
2025-12-27 01:48:17 -03:00
|
|
|
#[command(subcommand)]
|
|
|
|
|
pub command: Command,
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#[derive(Debug, Subcommand, PartialEq)]
|
|
|
|
|
pub enum Command {
|
|
|
|
|
/// Downloads the card data
|
2025-12-28 21:20:16 -03:00
|
|
|
DownloadData {
|
|
|
|
|
/// Language to download the data in
|
|
|
|
|
#[arg(short, value_parser=<Language as FromStr>::from_str)]
|
|
|
|
|
lang: Language,
|
|
|
|
|
},
|
2025-12-27 01:48:17 -03:00
|
|
|
/// Terminal User Interface
|
|
|
|
|
Tui,
|
2025-04-28 19:02:32 -04:00
|
|
|
}
|