Add Clap and base config

This commit is contained in:
Thomas Wickham
2021-03-02 20:13:58 +01:00
parent 6519b5c894
commit 845073c29d
6 changed files with 42 additions and 2 deletions

0
src/domain/.keep Normal file
View File

10
src/infra/cli.rs Normal file
View File

@@ -0,0 +1,10 @@
use clap::Clap;
/// lldap is a lightweight LDAP server
#[derive(Debug, Clap)]
#[clap(version = "0.1", author = "The LLDAP team")]
pub struct CLIOpts;
pub fn init() -> CLIOpts {
CLIOpts::parse()
}

View File

@@ -0,0 +1,6 @@
#[derive(Debug, Default)]
pub struct Configuration;
pub fn init() -> Configuration {
Configuration::default()
}

2
src/infra/mod.rs Normal file
View File

@@ -0,0 +1,2 @@
pub mod cli;
pub mod configuration;

View File

@@ -1,3 +1,7 @@
mod infra;
fn main() {
println!("Hello, world!");
let config = infra::configuration::init();
let cli_opts = infra::cli::init();
println!("Hello, world! Config: {:?}, CLI: {:?}", config, cli_opts);
}