patch category
This commit is contained in:
		
							parent
							
								
									0d4dd55996
								
							
						
					
					
						commit
						91befad113
					
				@ -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")
 | 
			
		||||
 | 
			
		||||
@ -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!()
 | 
			
		||||
        }
 | 
			
		||||
    };
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user