cuddle-templates/rust-cli/crates/%%name%%/src/main.rs
kjuulh 12735aa1c5
feat: update template for cli
Signed-off-by: kjuulh <contact@kjuulh.io>
2023-07-28 21:31:23 +02:00

32 lines
578 B
Rust

use std::net::SocketAddr;
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 {
Init
}
#[tokio::main]
async fn main() -> anyhow::Result<()> {
dotenv::dotenv().ok();
tracing_subscriber::fmt::init();
let cli = Command::parse();
match cli.command.unwrap() {
Commands::Init => {
tracing::info!("hello %%name%%");
}
}
Ok(())
}