feat: add possibility to pass options to fd and find

This commit is contained in:
Lucien Cartier-Tilet 2023-07-08 12:21:09 +02:00
parent df13ed9ce3
commit 7c4af643f9
Signed by: phundrak
GPG Key ID: BD7789E705CB8DCA
1 changed files with 17 additions and 3 deletions

View File

@ -74,6 +74,16 @@ extension, such as
:group 'ivy-quick-find-files
:type 'list)
(defcustom ivy-quick-find-files-fd-additional-options ""
"Additional command-line options for fd."
:group 'ivy-quick-find-files
:type 'string)
(defcustom ivy-quick-find-files-find-additional-options ""
"Additional command-line options for find."
:group 'ivy-quick-find-files
:type 'string)
; Internal functions ;;;;;;;;;;;;;;;;;;
(defun ivy-quick-find-files--split-lines (str &optional omit-null)
@ -92,11 +102,15 @@ Return files as a list of absolute paths."
(ivy-quick-find-files--split-lines
(shell-command-to-string (format
(pcase ivy-quick-find-files-program
('fd "fd . %s -e %s -c never")
('find "find %s -name \"*.%s\"")
('fd "fd . %s -e %s -c never %s")
('find "find %s -name \"*.%s\" %s")
(otherwise (error "Find program %s not implemented" otherwise)))
dir
ext))))
ext
(pcase ivy-quick-find-files-program
('fd ivy-quick-find-files-fd-additional-options)
('find ivy-quick-find-files-find-additional-options)
(otherwise (error "Find program %s not implemented" otherwise)))))))
; Public functions ;;;;;;;;;;;;;;;;;;;;