You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
helix/helix-term/src/main.rs

37 lines
775 B
Rust

#![allow(unused)]
mod editor;
4 years ago
use editor::Editor;
4 years ago
use clap::{App, Arg};
use std::path::PathBuf;
4 years ago
use anyhow::Error;
4 years ago
static EX: smol::Executor = smol::Executor::new();
4 years ago
fn main() -> Result<(), Error> {
let args = App::new("helix")
.version("0.1")
.about("A post-modern text editor.")
.arg(
Arg::new("files")
.about("Sets the input file to use")
.required(true)
.multiple(true)
.index(1),
)
.get_matches();
4 years ago
for _ in 0..num_cpus::get() {
std::thread::spawn(move || smol::block_on(EX.run(smol::future::pending::<()>())));
}
smol::block_on(EX.run(async {
editor::Editor::new(args).unwrap().run().await;
}));
4 years ago
Ok(())
}