A file-based task manager

Default to searching body

+7 -7
+4 -4
src/main.rs
··· 222 struct FindArgs { 223 /// Include the contents of tasks in the search criteria. 224 #[arg(short = 'b', default_value_t = false)] 225 - search_body: bool, 226 /* TODO: implement this 227 /// Include archived tasks in the search criteria. Combine with `-b` to include archived 228 /// bodies in the search criteria. ··· 237 TaskIdentifier::Id(id) 238 } else if value.find.find { 239 TaskIdentifier::Find { 240 - search_body: value.find.args.search_body, 241 archived: false, 242 } 243 } else { ··· 291 relative_id: 0, 292 find: Find { 293 find: false, 294 - args: FindArgs { search_body: false }, 295 }, 296 } 297 } ··· 405 } 406 407 fn command_find(dir: PathBuf, short_id: bool, find_args: FindArgs) -> Result<()> { 408 - let id = Workspace::from_path(dir)?.search(None, find_args.search_body, false)?; 409 if let Some(id) = id { 410 if short_id { 411 // print as integer
··· 222 struct FindArgs { 223 /// Include the contents of tasks in the search criteria. 224 #[arg(short = 'b', default_value_t = false)] 225 + exclude_body: bool, 226 /* TODO: implement this 227 /// Include archived tasks in the search criteria. Combine with `-b` to include archived 228 /// bodies in the search criteria. ··· 237 TaskIdentifier::Id(id) 238 } else if value.find.find { 239 TaskIdentifier::Find { 240 + exclude_body: value.find.args.exclude_body, 241 archived: false, 242 } 243 } else { ··· 291 relative_id: 0, 292 find: Find { 293 find: false, 294 + args: FindArgs { exclude_body: true }, 295 }, 296 } 297 } ··· 405 } 406 407 fn command_find(dir: PathBuf, short_id: bool, find_args: FindArgs) -> Result<()> { 408 + let id = Workspace::from_path(dir)?.search(None, !find_args.exclude_body, false)?; 409 if let Some(id) = id { 410 if short_id { 411 // print as integer
+3 -3
src/workspace.rs
··· 62 pub enum TaskIdentifier { 63 Id(Id), 64 Relative(u32), 65 - Find { search_body: bool, archived: bool }, 66 } 67 68 impl From<Id> for TaskIdentifier { ··· 114 Ok(stack_item.id) 115 } 116 TaskIdentifier::Find { 117 - search_body, 118 archived, 119 } => self 120 - .search(None, search_body, archived)? 121 .ok_or(Error::NotSelected), 122 } 123 }
··· 62 pub enum TaskIdentifier { 63 Id(Id), 64 Relative(u32), 65 + Find { exclude_body: bool, archived: bool }, 66 } 67 68 impl From<Id> for TaskIdentifier { ··· 114 Ok(stack_item.id) 115 } 116 TaskIdentifier::Find { 117 + exclude_body, 118 archived, 119 } => self 120 + .search(None, !exclude_body, archived)? 121 .ok_or(Error::NotSelected), 122 } 123 }