mod comments;
mod events;
mod markets;
mod series;
mod sports;
mod tags;
use clap::{Subcommand, ValueEnum};
use color_eyre::eyre::Result;
use polyte_gamma::Gamma;
#[derive(Subcommand)]
pub enum GammaCommand {
Markets {
#[command(subcommand)]
command: markets::MarketsCommand,
},
Events {
#[command(subcommand)]
command: events::EventsCommand,
},
Tags {
#[command(subcommand)]
command: tags::TagsCommand,
},
Series {
#[command(subcommand)]
command: series::SeriesCommand,
},
Sports {
#[command(subcommand)]
command: sports::SportsCommand,
},
Comments {
#[command(subcommand)]
command: comments::CommentsCommand,
},
}
impl GammaCommand {
pub async fn run(self) -> Result<()> {
let gamma = Gamma::new()?;
match self {
Self::Markets { command } => command.run(&gamma).await,
Self::Events { command } => command.run(&gamma).await,
Self::Tags { command } => command.run(&gamma).await,
Self::Series { command } => command.run(&gamma).await,
Self::Sports { command } => command.run(&gamma).await,
Self::Comments { command } => command.run(&gamma).await,
}
}
}
#[derive(Debug, Clone, Copy, ValueEnum, Default)]
pub enum SortOrder {
Asc,
#[default]
Desc,
}