feat: update template for cli

Signed-off-by: kjuulh <contact@kjuulh.io>
This commit is contained in:
2023-07-28 21:31:23 +02:00
parent 60b81f10e4
commit 12735aa1c5
5 changed files with 33 additions and 53 deletions

View File

@@ -0,0 +1,31 @@
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(())
}