mirror of
https://gitlab.computer.surgery/matrix/grapevine.git
synced 2025-12-17 15:51:23 +01:00
require config path via cli, remove env var
This commit is contained in:
parent
3650fde0ac
commit
9b115b4110
4 changed files with 11 additions and 23 deletions
10
src/main.rs
10
src/main.rs
|
|
@ -108,17 +108,11 @@ async fn main() -> ExitCode {
|
|||
async fn try_main() -> Result<(), error::Main> {
|
||||
use error::Main as Error;
|
||||
|
||||
args::parse();
|
||||
let args = args::parse();
|
||||
|
||||
// Initialize config
|
||||
let raw_config = Figment::new()
|
||||
.merge(
|
||||
Toml::file({
|
||||
let name = "GRAPEVINE_CONFIG";
|
||||
Env::var(name).ok_or(Error::ConfigPathUnset(name))?
|
||||
})
|
||||
.nested(),
|
||||
)
|
||||
.merge(Toml::file(&args.config).nested())
|
||||
.merge(Env::prefixed("GRAPEVINE_").global());
|
||||
|
||||
let config = raw_config.extract::<Config>()?;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue