1pub mod cli;
2pub mod commands;
3pub mod config;
4pub mod db;
5pub mod jira;
6pub mod report;
7pub mod sync;
8pub mod toggl;
9
10pub async fn run(cli: cli::Cli) -> anyhow::Result<()> {
11 match cli.command {
12 Some(cli::Command::Sync(args)) => commands::sync::run(args).await,
13 Some(cli::Command::Recover(args)) => commands::recover::run(args).await,
14 Some(cli::Command::Config(args)) => commands::config::run(args).await,
15 Some(cli::Command::Doctor(args)) => commands::doctor::run(args).await,
16 Some(cli::Command::Status(args)) => commands::status::run(args).await,
17 Some(cli::Command::Tui(args)) => commands::tui::run(args).await,
18 Some(cli::Command::Schedule(args)) => commands::schedule::run(args),
19 None => {
20 commands::tui::run(cli::TuiArgs {
21 paths: cli::SharedPaths {
22 config: None,
23 db: None,
24 },
25 limit: 200,
26 })
27 .await
28 }
29 }
30}