2020-06-02 03:57:01 +02:00
|
|
|
#![allow(unused)]
|
2020-05-28 10:47:35 +02:00
|
|
|
// mod editor;
|
2020-06-07 17:28:17 +02:00
|
|
|
// mod component;
|
2020-06-04 01:05:01 +02:00
|
|
|
mod editor;
|
2020-06-07 17:28:17 +02:00
|
|
|
mod keymap;
|
2020-05-20 11:14:51 +02:00
|
|
|
|
2020-06-04 01:05:01 +02:00
|
|
|
use editor::Editor;
|
2020-05-20 11:14:51 +02:00
|
|
|
|
2020-05-25 06:02:21 +02:00
|
|
|
use argh::FromArgs;
|
2020-06-02 03:57:01 +02:00
|
|
|
use std::path::PathBuf;
|
2020-05-20 11:14:51 +02:00
|
|
|
|
2020-05-25 06:02:21 +02:00
|
|
|
use anyhow::Error;
|
2020-05-20 11:14:51 +02:00
|
|
|
|
2020-05-25 06:02:21 +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> {
|
2020-05-25 06:02:21 +02:00
|
|
|
let args: Args = argh::from_env();
|
2020-06-05 12:21:27 +02:00
|
|
|
println!("{:?}", args.files);
|
2020-05-20 11:14:51 +02:00
|
|
|
|
2020-06-16 11:00:34 +02:00
|
|
|
let mut editor = editor::Editor::new(args)?;
|
|
|
|
editor.run();
|
2020-05-20 11:14:51 +02:00
|
|
|
|
|
|
|
Ok(())
|
|
|
|
}
|