summaryrefslogtreecommitdiff
path: root/helix-term/src/main.rs
blob: e14a328f52dac82abe2a5f4b6d42da9fca99d6a9 (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
29
30
31
32
33
34
#![allow(unused)]

mod application;

use application::Application;

use clap::{App, Arg};
use std::path::PathBuf;

use anyhow::Error;

static EX: smol::Executor = smol::Executor::new();

fn main() -> Result<(), Error> {
    let args = clap::app_from_crate!()
        .arg(
            Arg::new("files")
                .about("Sets the input file to use")
                .required(true)
                .multiple(true)
                .index(1),
        )
        .get_matches();

    for _ in 0..num_cpus::get() {
        std::thread::spawn(move || smol::block_on(EX.run(smol::future::pending::<()>())));
    }

    smol::block_on(EX.run(async {
        Application::new(args).unwrap().run().await;
    }));

    Ok(())
}