summaryrefslogtreecommitdiffstats
path: root/src/bin/client/main.rs
blob: 1b701d848b32a42050e3726f0ca6d7c5201efe9c (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#[macro_use]
mod macros;
mod connection;
mod repl;
mod tls;

use repl::ClientState;

fn main() {
    let args: Vec<String> = std::env::args().collect();
    let unsafe_mode = args.iter().any(|arg| arg == "--unsafe");

    if unsafe_mode {
        println!("WARNING: Running in UNSAFE mode - certificate verification disabled!");
    }

    connection::set_unsafe_mode(unsafe_mode);

    let mut state = ClientState::new();
    if let Some(host) = state.addr.clone() {
        state.connect_to(&host);
    }

    println!("Welcome to Zagan-Bet Client!");
    println!("Type 'help' for available commands.");

    state.run();
}