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 {
pub async fn new<'a>() -> Self {
let argp = Context::argparse();
// 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();
//.unwrap_or(format!("https://{}", MASTERSERVER).as_str())
//.to_string();
// Build context
let mut ctx = Context {