improvement: use clap for command line args

This commit is contained in:
Rasmus Schlunsen
2023-01-05 14:47:34 +01:00
committed by Greg Heartsfield
parent d06d227ebe
commit 73f4f60cc7
6 changed files with 178 additions and 40 deletions

14
src/cli.rs Normal file
View File

@@ -0,0 +1,14 @@
use clap::Parser;
#[derive(Parser)]
#[command(about = "A nostr relay written in Rust", author = env!("CARGO_PKG_AUTHORS"), version = env!("CARGO_PKG_VERSION"))]
pub struct CLIArgs {
#[arg(
short,
long,
help = "Use the <directory> as the location of the database",
default_value = ".",
required = false
)]
pub db: String,
}