Commit
Author: Kevin Schoon [kevinschoon@gmail.com]
Hash: c07b5d03ca0f758225cd0168df27c02ed93fa7b8
Timestamp: Wed, 17 Feb 2021 15:11:47 +0000 (3 years ago)

+8 -7 +/-2 browse
rename Note.Filter -> Note.Search
1diff --git a/lib/cmd.ml b/lib/cmd.ml
2index c2c167c..b950400 100644
3--- a/lib/cmd.ml
4+++ b/lib/cmd.ml
5 @@ -81,7 +81,7 @@ json for consumption by other tools.
6 ~doc:"format [json | yaml | raw] (default: raw)"
7 in
8 fun () ->
9- let open Note.Filter in
10+ let open Note.Search in
11 let filter_kind = if fulltext then Some Fulltext else None in
12 let notes =
13 find_many ?strategy:filter_kind ~args:filter_args get_notes
14 @@ -154,11 +154,11 @@ Delete the first note that matches the filter criteria.
15 ~doc:"perform a fulltext search instead of just key comparison"
16 in
17 fun () ->
18- let open Note.Filter in
19+ let open Note.Search in
20 let filter_kind = if fulltext then Fulltext else Keys in
21 let notes = get_notes in
22 let note =
23- Note.Filter.find_one ~strategy:filter_kind ~args:filter_args notes
24+ Note.Search.find_one ~strategy:filter_kind ~args:filter_args notes
25 in
26 match note with
27 | Some note ->
28 @@ -180,7 +180,7 @@ Select a note that matches the filter criteria and open it in your text editor.
29 ~doc:"perform a fulltext search instead of just key comparison"
30 in
31 fun () ->
32- let open Note.Filter in
33+ let open Note.Search in
34 let filter_kind = if fulltext then Fulltext else Keys in
35 let note = find_one ~strategy:filter_kind ~args:filter_args get_notes in
36 match note with
37 @@ -212,10 +212,10 @@ is provided then all notes will be listed.
38 ~doc:"columns to include in output"
39 in
40 fun () ->
41- let open Note.Filter in
42+ let open Note.Search in
43 let filter_kind = if fulltext then Some Fulltext else None in
44 let notes =
45- Note.Filter.find_many ?strategy:filter_kind ~args:filter_args
46+ Note.Search.find_many ?strategy:filter_kind ~args:filter_args
47 get_notes
48 in
49 let styles = cfg.styles in
50 diff --git a/lib/note.ml b/lib/note.ml
51index 636a293..229760d 100644
52--- a/lib/note.ml
53+++ b/lib/note.ml
54 @@ -165,7 +165,8 @@ module Encoding = struct
55 | `Yaml -> Yaml.to_string_exn (to_json t)
56 end
57
58- module Filter = struct
59+ module Search = struct
60+
61 type strategy = Keys | Fulltext
62
63 let title key note = String.equal key (get_title note)