commit 0557e2241c72507941eff165a1a76ea0c1ab4445
parent 232cc39e8eae536edebde11ab3145ab9cd976dbe
Author: ChanderG <[email protected]>
Date: Mon, 8 Dec 2025 18:28:31 +0530
use anaphoric if
Diffstat:
3 files changed, 8 insertions(+), 5 deletions(-)
diff --git a/grep.asd b/grep.asd
@@ -1,6 +1,7 @@
(asdf:defsystem grep
:version "0.0.1"
:author "Chander Govindarajan"
+ :serial t
:components ((:file "package")
(:file "options")
(:file "log")
@@ -14,7 +15,8 @@
:bordeaux-threads
:cl-string-match
:mmap
- :unix-opts)
+ :unix-opts
+ :anaphora)
:build-operation "program-op"
:build-pathname "cl-grep"
:entry-point "cl-grep:main")
diff --git a/options.lisp b/options.lisp
@@ -28,10 +28,10 @@
(format t "Unknown option: ~a. Aborting!" (opts:option c))
(opts:exit 1)))
;; deal with the options here
- (if (getf options :jobs)
- (setf +numw+ (getf options :jobs)))
+ (aif (getf options :jobs)
+ (setf +numw+ it))
(if (getf options :mmap)
(setf grep-file-mode 'mmap))
- (if (getf options :chunk-size)
- (setf +chunk-size+ (getf options :chunk-size)))
+ (aif (getf options :chunk-size)
+ (setf +chunk-size+ it))
free-args))
diff --git a/package.lisp b/package.lisp
@@ -3,4 +3,5 @@
(:local-nicknames (:fsu :org.shirakumo.filesystem-utils)
(:pu :org.shirakumo.pathname-utils)
(:lq :lparallel.queue))
+ (:import-from :anaphora #:aif #:it)
(:export #:main #:grep-func))