32 lines
578 B
Rust
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(())
|
||
|
}
|