minimal main

This commit is contained in:
Volodymyr Patuta 2020-11-27 21:00:07 +01:00
parent 90948a1c83
commit fefd102101
1 changed files with 17 additions and 3 deletions

View File

@ -1,5 +1,19 @@
mod notes;
use anyhow::Result;
use rnote::{app, process};
fn main() {
println!("Hello, world!");
mod rnote;
fn main() -> Result<()> {
let mut app = app::make_app();
match rnote::app::make_app().get_matches().subcommand() {
("new", Some(m)) => process::new(m)?,
("remove", Some(m)) => process::remove(m)?,
("edit", Some(m)) => process::edit(m)?,
("list", Some(m)) => process::list(m)?,
("search", Some(m)) => process::search(m)?,
_ => app.print_long_help()?,
};
Ok(())
}