2024-08-23 21:51:42 +02:00
|
|
|
use anyhow::Context;
|
|
|
|
use clap::{Parser, Subcommand};
|
|
|
|
|
|
|
|
#[derive(Parser)]
|
|
|
|
#[command(author, version, about, long_about = None, subcommand_required = true)]
|
|
|
|
struct Command {
|
|
|
|
#[command(subcommand)]
|
|
|
|
command: Option<Commands>,
|
|
|
|
}
|
|
|
|
|
|
|
|
#[derive(Subcommand)]
|
|
|
|
enum Commands {
|
|
|
|
Hello {},
|
|
|
|
}
|
|
|
|
|
|
|
|
#[tokio::main]
|
|
|
|
async fn main() -> anyhow::Result<()> {
|
|
|
|
dotenv::dotenv().ok();
|
|
|
|
tracing_subscriber::fmt::init();
|
|
|
|
|
|
|
|
let cli = Command::parse();
|
2024-08-23 21:53:25 +02:00
|
|
|
tracing::debug!("Starting cli");
|
2024-08-23 21:51:42 +02:00
|
|
|
|
2024-08-23 21:53:25 +02:00
|
|
|
if let Some(Commands::Hello {}) = cli.command {
|
2024-08-23 21:51:42 +02:00
|
|
|
println!("Hello!")
|
|
|
|
}
|
|
|
|
|
|
|
|
Ok(())
|
|
|
|
}
|