diff options
author | Blaž Hrastnik | 2020-10-01 03:23:07 +0000 |
---|---|---|
committer | Blaž Hrastnik | 2020-10-01 03:25:03 +0000 |
commit | e39bd211d1579bfafa1774f6915af5725041781e (patch) | |
tree | 258a92098896a3e903da6b27a076388e2a6a0fb6 /helix-term/src/main.rs | |
parent | 1da0be0aa045a4acd0246d82bf6214f8ec651476 (diff) |
argh -> clap to speed up compilation (no syn/proc_macro)
Diffstat (limited to 'helix-term/src/main.rs')
-rw-r--r-- | helix-term/src/main.rs | 21 |
1 files changed, 12 insertions, 9 deletions
diff --git a/helix-term/src/main.rs b/helix-term/src/main.rs index b691eb65..eeb498bc 100644 --- a/helix-term/src/main.rs +++ b/helix-term/src/main.rs @@ -4,22 +4,25 @@ mod editor; use editor::Editor; -use argh::FromArgs; +use clap::{App, Arg}; use std::path::PathBuf; use anyhow::Error; -#[derive(FromArgs)] -/// A post-modern text editor. -pub struct Args { - #[argh(positional)] - files: Vec<PathBuf>, -} - static EX: smol::Executor = smol::Executor::new(); fn main() -> Result<(), Error> { - let args: Args = argh::from_env(); + 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(); for _ in 0..num_cpus::get() { std::thread::spawn(move || smol::block_on(EX.run(smol::future::pending::<()>()))); |