27 lines
672 B
Rust
27 lines
672 B
Rust
use anyhow::{anyhow, Result};
|
|
use clap::Parser;
|
|
|
|
mod certs;
|
|
mod common;
|
|
mod crypto_provider;
|
|
mod openssl;
|
|
mod vars;
|
|
|
|
use crate::certs::build_client_config;
|
|
use crate::common::{AppConfig, Args};
|
|
use crate::vars::VarsFile;
|
|
|
|
#[tokio::main(flavor = "current_thread")]
|
|
async fn main() -> Result<()> {
|
|
let args = Args::parse();
|
|
let config = AppConfig::from(&args);
|
|
let mut vars = VarsFile::from_config(&config).await?;
|
|
vars.parse().await?;
|
|
|
|
println!("found vars: {}", vars.filepath.to_str().expect("fff"));
|
|
println!("loaded: {:#?}", &vars.vars);
|
|
|
|
let vars = vars.vars.ok_or(anyhow!("no vars loaded"))?;
|
|
build_client_config(&config, vars).await
|
|
}
|