1mod base;
2mod commands;
3use clap::{Parser, Subcommand};
4#[derive(Parser, Debug, Clone)]
5pub struct Args {
6 #[command(subcommand)]
7 command: SubCommands,
8}
9
10#[derive(Subcommand, Debug, Clone)]
11pub enum SubCommands {
12 Serve,
14 Calculate(commands::calculate::Args),
16
17 Daemon(commands::daemon::Args),
19
20 Next(commands::next::Args)
22}
23
24pub async fn run(args: Args) {
25 match args.command {
26 SubCommands::Serve => commands::serve::serve().await,
27 SubCommands::Calculate(c) => commands::calculate::run(c),
28 SubCommands::Daemon(d) => commands::daemon::run(d).await,
29 SubCommands::Next(n) => commands::next::run(n),
30 }
31}