A file-based task manager

FIX: docstring for find output, change default

+8 -8
+8 -8
src/main.rs
··· 90 Find { 91 #[command(flatten)] 92 args: FindArgs, 93 - /// Whether to print the full TSK-ID (instead of just an integer) 94 - #[arg(short = 'F', default_value_t = true)] 95 - full_id: bool, 96 }, 97 98 /// Prints the contents of a task, parsing the body as rich text and formatting it using ANSI ··· 251 Commands::Edit { task_id } => command_edit(dir, task_id), 252 Commands::Completion { shell } => command_completion(shell), 253 Commands::Drop { task_id } => command_drop(dir, task_id), 254 - Commands::Find { args, full_id } => command_find(dir, full_id, args), 255 Commands::Rot => Workspace::from_path(dir).unwrap().rot(), 256 Commands::Tor => Workspace::from_path(dir).unwrap().tor(), 257 Commands::Prioritize { task_id } => command_prioritize(dir, task_id), ··· 373 Ok(()) 374 } 375 376 - fn command_find(dir: PathBuf, full_id: bool, find_args: FindArgs) -> Result<()> { 377 let id = Workspace::from_path(dir)?.search(None, find_args.search_body, false)?; 378 if let Some(id) = id { 379 - if full_id { 380 - println!("{id}"); 381 - } else { 382 // print as integer 383 println!("{}", id.0); 384 } 385 } else { 386 eprintln!("No task selected.");
··· 90 Find { 91 #[command(flatten)] 92 args: FindArgs, 93 + /// Whether to print the a shortened tsk ID (just the integer portion). Defaults to *false* 94 + #[arg(short = 'f', default_value_t = false)] 95 + short_id: bool, 96 }, 97 98 /// Prints the contents of a task, parsing the body as rich text and formatting it using ANSI ··· 251 Commands::Edit { task_id } => command_edit(dir, task_id), 252 Commands::Completion { shell } => command_completion(shell), 253 Commands::Drop { task_id } => command_drop(dir, task_id), 254 + Commands::Find { args, short_id } => command_find(dir, short_id, args), 255 Commands::Rot => Workspace::from_path(dir).unwrap().rot(), 256 Commands::Tor => Workspace::from_path(dir).unwrap().tor(), 257 Commands::Prioritize { task_id } => command_prioritize(dir, task_id), ··· 373 Ok(()) 374 } 375 376 + fn command_find(dir: PathBuf, short_id: bool, find_args: FindArgs) -> Result<()> { 377 let id = Workspace::from_path(dir)?.search(None, find_args.search_body, false)?; 378 if let Some(id) = id { 379 + if short_id { 380 // print as integer 381 println!("{}", id.0); 382 + } else { 383 + println!("{id}"); 384 } 385 } else { 386 eprintln!("No task selected.");