use clap::{Parser, Subcommand};
use tracing_subscriber::EnvFilter;
mod commands;
#[derive(Parser)]
#[command(name = "git-notes", version, about, long_about = None)]
struct Cli {
#[command(subcommand)]
command: Commands,
}
#[derive(Subcommand)]
enum Commands {
Add(commands::add::AddArgs),
Reply(commands::reply::ReplyArgs),
List(commands::list::ListArgs),
Show(commands::show::ShowArgs),
Sync(commands::sync::SyncArgs),
Resolve(commands::resolve::ResolveArgs),
Export(commands::export::ExportArgs),
Completions(commands::completions::CompletionsArgs),
}
fn main() -> anyhow::Result<()> {
tracing_subscriber::fmt()
.with_env_filter(EnvFilter::from_default_env())
.init();
let cli = Cli::parse();
match &cli.command {
Commands::Add(args) => commands::add::run(args),
Commands::Reply(args) => commands::reply::run(args),
Commands::List(args) => commands::list::run(args),
Commands::Show(args) => commands::show::run(args),
Commands::Sync(args) => commands::sync::run(args),
Commands::Resolve(args) => commands::resolve::run(args),
Commands::Export(args) => commands::export::run(args),
Commands::Completions(args) => commands::completions::run(args),
}
}