diff --git a/Cargo.lock b/Cargo.lock index b01075a..4394ccc 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -278,6 +278,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "046ae530c528f252094e4a77886ee1374437744b2bff1497aa898bbddbbb29b3" dependencies = [ "clap_builder", + "clap_derive", + "once_cell", ] [[package]] @@ -293,6 +295,18 @@ dependencies = [ "strsim", ] +[[package]] +name = "clap_derive" +version = "4.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3f9644cd56d6b87dbe899ef8b053e331c0637664e9e21a33dfcdc36093f5c5c4" +dependencies = [ + "heck", + "proc-macro2", + "quote", + "syn 2.0.10", +] + [[package]] name = "clap_lex" version = "0.4.1" @@ -672,6 +686,12 @@ dependencies = [ "ahash 0.8.3", ] +[[package]] +name = "heck" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "95505c38b4572b2d910cecb0281560f54b440a19336cbbcb27bf6ce6adc6f5a8" + [[package]] name = "hermit-abi" version = "0.3.1" diff --git a/Cargo.toml b/Cargo.toml index 067de84..1c90a5e 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -6,7 +6,7 @@ edition = "2021" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] -clap = "4.2.1" +clap = { version = "4.2.1", features = ["derive"] } directories = "5.0.0" dotenv = "0.15.0" mysql = "23.0.1" diff --git a/src/cli/cli.rs b/src/cli/cli.rs index 0d0e696..9504195 100644 --- a/src/cli/cli.rs +++ b/src/cli/cli.rs @@ -5,9 +5,9 @@ use clap::Parser; #[command(author = "Mathias Rothenhaeusler")] #[command(version = "1.0")] #[command(about = "Tool collection for work at RCC.", long_about = None)] -struct Cli { +pub struct Cli { #[arg(short, long)] - environment: String, + env: String, #[arg(short, long)] one: String, } diff --git a/src/main.rs b/src/main.rs index 7f392d3..3b2e786 100644 --- a/src/main.rs +++ b/src/main.rs @@ -5,6 +5,7 @@ use repository::merchant_repo; pub mod database; pub mod entity; pub mod repository; +pub mod cli; #[derive(Debug, PartialEq, Eq)] struct Payment {