aboutsummaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
authorMarc Coquand <marc@mccd.space>2024-05-16 09:29:19 -0500
committerMarc Coquand <marc@mccd.space>2024-05-16 09:29:19 -0500
commita9b8ac50daf0cd28034c310dc1cda07ba9a2fc0c (patch)
tree1d381e5c18ad379b2eee62e6bc0f507e3508813e /bin
parente57d29c39da80f9ef9cb68a9322ad2c4254f2d80 (diff)
downloadstitch-a9b8ac50daf0cd28034c310dc1cda07ba9a2fc0c.tar.gz
stitch-a9b8ac50daf0cd28034c310dc1cda07ba9a2fc0c.tar.bz2
stitch-a9b8ac50daf0cd28034c310dc1cda07ba9a2fc0c.zip
Document environment variables
Diffstat (limited to 'bin')
-rw-r--r--bin/main.ml53
1 files changed, 52 insertions, 1 deletions
diff --git a/bin/main.ml b/bin/main.ml
index 1fba7a3..cda58ca 100644
--- a/bin/main.ml
+++ b/bin/main.ml
@@ -7,10 +7,61 @@ let tag_arg =
let headlines_t = Term.(const Stitch.start $ tag_arg $ const ())
+let envs =
+ let docs = "ENVIRONMENT VARIABLES" in
+ [ Cmd.Env.info
+ ~docs
+ ~doc:
+ "Directory where Stitch should search for notes. Needs to be set in order for \
+ the program to work. Must be absolute path, I.E /home/bob/notes"
+ "STITCH_DIRECTORY"
+ ; Cmd.Env.info
+ ~docs
+ ~doc:
+ "Grep command to use (defaults to \"grep\"). Stitch also works well with ugrep, \
+ which greatly speeds up the program."
+ "STITCH_GREP_CMD"
+ ; Cmd.Env.info
+ ~docs
+ ~doc:"Pattern to use for headlines. (Default \"* \")"
+ "STITCH_HEADLINE_PATTERN"
+ ; Cmd.Env.info
+ ~docs
+ ~doc:
+ "Pattern to use by grep to fetch headlines. Needs to be double escaped for \
+ OCaml. (Default \"^\\* \")"
+ "STITCH_HEADLINE_PATTERN_REGEXP"
+ ; Cmd.Env.info
+ ~docs
+ ~doc:"Pattern used by grep to find tags. (Default \":[a-z-]+:\", matches :a-tag:"
+ "STITCH_TAG_PATTERN"
+ ; Cmd.Env.info
+ ~docs
+ ~doc:"Pattern for TODOS. Used for substitution. (Default \"* TODO\")"
+ "STITCH_TODO"
+ ; Cmd.Env.info
+ ~docs
+ ~doc:
+ "Regexp used by grep to find TODO items. Needs to be double escaped for OCaml. \
+ (Default \"^\\* TODO\")"
+ "STITCH_TODO_REGEXP"
+ ; Cmd.Env.info
+ ~docs
+ ~doc:"Pattern for DONE items. Used for substitution. (Default \"* DONE\")"
+ "STITCH_DONE"
+ ; Cmd.Env.info
+ ~docs
+ ~doc:
+ "Regexp used by grep to find DONE items. Needs to be double escaped for OCaml. \
+ (Default \"^\\* DONE\")"
+ "STITCH_DONE_REGEXP"
+ ]
+
+
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
+ let info = Cmd.info ~envs "headlines" ~version:"0.1" ~doc ~man in
Cmd.v info headlines_t