Skip to content

Commit

Permalink
Getting values from CLI, how to use them now?
Browse files Browse the repository at this point in the history
  • Loading branch information
lyderic committed Sep 4, 2024
1 parent 90fbdc9 commit 85f5366
Showing 1 changed file with 5 additions and 11 deletions.
16 changes: 5 additions & 11 deletions src/app_config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,10 @@ use clap::Parser;
pub struct Cli {
/// web root
#[clap(short,long,default_value=".")]
web_root: PathBuf,
/// database url
#[clap(short,long,default_value="sqlite::memory")]
database_url: String,
/// port
#[clap(short,long,default_value_t=8080)]
port: u16,
/// interface to listen on
#[clap(short,long,default_value="127.0.0.1")]
listen_on: String,
pub web_root: PathBuf,
/// configuration directory
#[clap(short,long,default_value="sqlpage")]
pub config_dir: String,
}

#[cfg(not(feature = "lambda-web"))]
Expand Down Expand Up @@ -169,7 +163,7 @@ fn cannonicalize_if_possible(path: &std::path::Path) -> PathBuf {
pub fn load() -> anyhow::Result<AppConfig> {
let _cli = Cli::parse();
let configuration_directory = &configuration_directory();
load_from_directory(configuration_directory)
load_from_directory(&configuration_directory)
}

/// Parses and loads the configuration from the given directory.
Expand Down

0 comments on commit 85f5366

Please sign in to comment.