aboutsummaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
authorMarc Coquand <marc@mccd.space>2024-05-14 10:46:28 -0500
committerMarc Coquand <marc@mccd.space>2024-05-14 10:46:28 -0500
commitbe2bf751536850e7bdfbd876ef908c5d6cf00087 (patch)
tree91d426b4b9f2e763aa5f23931f5ef166b47c2393 /bin
parentfde592dbbb97a89a498feb95f97bee674bd571e8 (diff)
downloadstitch-be2bf751536850e7bdfbd876ef908c5d6cf00087.tar.gz
stitch-be2bf751536850e7bdfbd876ef908c5d6cf00087.tar.bz2
stitch-be2bf751536850e7bdfbd876ef908c5d6cf00087.zip
Add search and tag search
Diffstat (limited to 'bin')
-rw-r--r--bin/main.ml17
1 files changed, 16 insertions, 1 deletions
diff --git a/bin/main.ml b/bin/main.ml
index bb7dc1e..78d30ba 100644
--- a/bin/main.ml
+++ b/bin/main.ml
@@ -1,3 +1,18 @@
open Stitch
+open Cmdliner
-let () = Headlines.start ()
+let tag_arg =
+ let doc = "Search entries for a given tag." in
+ Arg.(value & opt string "" & info [ "t"; "tag" ] ~docv:"TAG" ~doc)
+
+
+let headlines_t = Term.(const Headlines.start $ tag_arg $ const ())
+
+let headlines_cmd =
+ let doc = "Show titles in a condensed list" in
+ let man = [ `S Manpage.s_bugs; `P "Email bug reports to marc@mccd.space" ] in
+ let info = Cmd.info "headlines" ~version:"0.1" ~doc ~man in
+ Cmd.v info headlines_t
+
+
+let () = exit (Cmd.eval headlines_cmd)