Skip to content

Commit

Permalink
Improve docs
Browse files Browse the repository at this point in the history
  • Loading branch information
BostX committed Feb 5, 2022
1 parent df6820b commit e970745
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 9 deletions.
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,10 @@ Installation:
raco pkg install ansi-color
raco exe -o ~/bin/search-notes main.rkt
```

See main.rkt/command-line/#:usage-help

TODO
two search patterns means
- search for block(s)
- then search within the found block(s)
19 changes: 10 additions & 9 deletions main.rkt
Original file line number Diff line number Diff line change
Expand Up @@ -54,11 +54,12 @@

(define case-sensitivity (make-parameter case-sensitive))

(define csd (format "case-sensitive `~a`~a or case-insensitive `~a`~a search."
case-sensitive
(if (equal? case-sensitive (case-sensitivity)) " (default)" "")
case-insensitive
(if (equal? case-sensitive (case-sensitivity)) "" " (default)")))
(define case-sensitivity-help-text
(format "case-sensitive `~a`~a or case-insensitive `~a`~a search."
case-sensitive
(if (equal? case-sensitive (case-sensitivity)) " (default)" "")
case-insensitive
(if (equal? case-sensitive (case-sensitivity)) "" " (default)")))

(command-line
#:program "search-notes"
Expand All @@ -74,11 +75,11 @@ racket main.rkt \\
;; TODO parameterize displayed color
;; TODO check if the case-sensitivity value is allowed
[("-f" "--files") fs
"A list of file to search through."
"A list of files to search through."
(files-prm fs)]
[("-c" "--case-sensitivity") cs
(csd)
(case-sensitivity cs)]
[("-c" "--case-sensitivity") CS
(case-sensitivity-help-text)
(case-sensitivity CS)]
[("-p" "--pattern") NAME
"Search pattern"
(pattern NAME)]
Expand Down

0 comments on commit e970745

Please sign in to comment.