update: config build refactor

This commit is contained in:
Paul 2023-01-07 15:46:03 +01:00
parent 9f03987285
commit 2e7bfcbfc6

View File

@ -50,12 +50,11 @@ pub struct Flags {
impl Context { impl Context {
pub async fn new<'a>() -> Self { pub async fn new<'a>() -> Self {
let argp = Context::argparse();
// Get flags // Get flags
let debug: bool = argp.contains_id("debug"); let argp: ArgMatches = Context::argparse();
//let debug: bool = argp.contains_id("debug");
let debug: bool = argp.get_one::<bool>("debug").unwrap().to_owned();
let server: String = argp.get_one::<String>("server").unwrap().to_string(); let server: String = argp.get_one::<String>("server").unwrap().to_string();
//.unwrap_or(format!("https://{}", MASTERSERVER).as_str())
//.to_string();
// Build context // Build context
let mut ctx = Context { let mut ctx = Context {