tangled
alpha
login
or
join now
ngp.computer
/
tsk
A file-based task manager
0
fork
atom
overview
issues
pulls
pipelines
Default to searching body
ngp.computer
2 months ago
cebd8634
29fccf98
+7
-7
2 changed files
expand all
collapse all
unified
split
src
main.rs
workspace.rs
+4
-4
src/main.rs
···
222
222
struct FindArgs {
223
223
/// Include the contents of tasks in the search criteria.
224
224
#[arg(short = 'b', default_value_t = false)]
225
225
-
search_body: bool,
225
225
+
exclude_body: bool,
226
226
/* TODO: implement this
227
227
/// Include archived tasks in the search criteria. Combine with `-b` to include archived
228
228
/// bodies in the search criteria.
···
237
237
TaskIdentifier::Id(id)
238
238
} else if value.find.find {
239
239
TaskIdentifier::Find {
240
240
-
search_body: value.find.args.search_body,
240
240
+
exclude_body: value.find.args.exclude_body,
241
241
archived: false,
242
242
}
243
243
} else {
···
291
291
relative_id: 0,
292
292
find: Find {
293
293
find: false,
294
294
-
args: FindArgs { search_body: false },
294
294
+
args: FindArgs { exclude_body: true },
295
295
},
296
296
}
297
297
}
···
405
405
}
406
406
407
407
fn command_find(dir: PathBuf, short_id: bool, find_args: FindArgs) -> Result<()> {
408
408
-
let id = Workspace::from_path(dir)?.search(None, find_args.search_body, false)?;
408
408
+
let id = Workspace::from_path(dir)?.search(None, !find_args.exclude_body, false)?;
409
409
if let Some(id) = id {
410
410
if short_id {
411
411
// print as integer
+3
-3
src/workspace.rs
···
62
62
pub enum TaskIdentifier {
63
63
Id(Id),
64
64
Relative(u32),
65
65
-
Find { search_body: bool, archived: bool },
65
65
+
Find { exclude_body: bool, archived: bool },
66
66
}
67
67
68
68
impl From<Id> for TaskIdentifier {
···
114
114
Ok(stack_item.id)
115
115
}
116
116
TaskIdentifier::Find {
117
117
-
search_body,
117
117
+
exclude_body,
118
118
archived,
119
119
} => self
120
120
-
.search(None, search_body, archived)?
120
120
+
.search(None, !exclude_body, archived)?
121
121
.ok_or(Error::NotSelected),
122
122
}
123
123
}