patch category

This commit is contained in:
Volodymyr Patuta 2020-11-27 21:20:19 +01:00
parent 0d4dd55996
commit 91befad113
2 changed files with 7 additions and 5 deletions

View File

@ -13,10 +13,13 @@ pub fn make_app() -> App<'static, 'static> {
.arg(
Arg::with_name("category")
.help("Create note in category.")
.short("c")
.long("category"),
.index(2),
)
.arg(Arg::with_name("header").help("Give name to the file.")),
.arg(
Arg::with_name("header")
.index(1)
.help("Give name to the file."),
),
)
.subcommand(
SubCommand::with_name("remove")

View File

@ -1,14 +1,13 @@
use crate::rnote::notes;
use anyhow::Result;
use clap::ArgMatches;
use notes::modify;
use text_io::read;
pub fn new(matches: &ArgMatches) -> Result<()> {
let header = match matches.value_of("header") {
Some(s) => s.to_owned(),
None => {
print!("Enter the name of your note: ");
println!("Enter the name of your note: ");
read!()
}
};