From 668798f7acd6d35e9995d4d75b426d9eeca99792 Mon Sep 17 00:00:00 2001 From: Rostislav Svoboda Date: Wed, 25 Oct 2023 22:12:06 +0200 Subject: [PATCH] New param -e --exact-filepaths --- main.rkt | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/main.rkt b/main.rkt index 8c656f4..f2ecae5 100644 --- a/main.rkt +++ b/main.rkt @@ -51,6 +51,7 @@ ansi-color) (define pattern-param (make-parameter "")) + (define filepaths-param (make-parameter "")) (define matching-files-param (make-parameter "")) (define case-sensitive "i") @@ -81,9 +82,16 @@ racket main.rkt -fp shells title racket main.rkt -n f shells -p title racket main.rkt -nfp shells title racket main.rkt -f \"shells|linux\" -p title +racket main.rkt -f \"lisp/racket\" -p rackjure +racket main.rkt -f \"lisp/racket\" -e \"/home/bost/der/search-notes/main.rkt /home/bost/der/search-notes/README.md\" -p subdir " + #:once-each ;; see also .spacemacs definition + [("-e" "--exact-filepaths") + FILEPATHS + "List of exact filepaths on the file system." + (filepaths-param FILEPATHS)] [("-f" "--files") REGEXP "Regexp matching a list of file-names in the org-roam directory to search in." @@ -184,6 +192,8 @@ directory to search in." (if (empty? strs) (list f) (list f (string-join strs "\n\n")))))) + ;; (lambda (files) (printf "files:\n~a\n" files) files) + (curry append (string-split (filepaths-param))) (lambda (predicate-filter-fun) "Return a list of files forming the search space." (let ([all-files (for/list ([f (in-directory dir)])