helix-mods/helix-term/src/main.rs

25 lines
374 B
Rust
Raw Normal View History

mod editor;
2020-05-20 11:14:51 +02:00
use editor::Editor;
2020-05-20 11:14:51 +02:00
use argh::FromArgs;
use std::{env, path::PathBuf};
2020-05-20 11:14:51 +02:00
use anyhow::Error;
2020-05-20 11:14:51 +02:00
#[derive(FromArgs)]
/// A post-modern text editor.
pub struct Args {
#[argh(positional)]
files: Vec<PathBuf>,
2020-05-20 11:14:51 +02:00
}
fn main() -> Result<(), Error> {
let args: Args = argh::from_env();
let mut editor = Editor::new(args)?;
2020-05-20 11:14:51 +02:00
editor.run()?;
2020-05-20 11:14:51 +02:00
Ok(())
}