From: Saba Saba Date: Thu, 9 Feb 2023 17:26:18 +0000 (-0500) Subject: Exposing *grep* publicly. X-Git-Url: http://sabadev.xyz:4321/?a=commitdiff_plain;h=2266cdacdbb1db1a00adf7ac78458ac5f3741974;p=git-repl.git Exposing *grep* publicly. --- diff --git a/git-repl.cl b/git-repl.cl index db137f0..84ed5ff 100644 --- a/git-repl.cl +++ b/git-repl.cl @@ -4,7 +4,10 @@ (in-package :cl-user) -(defvar *grep* "findstr" "The name of the program used for searching. On Windows this is set to \'findstr\', but it may be changed to \'grep\' for Unix systems.") +(defmacro defvar-public (name value &optional doc) + `(progn + (export ',name) + (defvar ,name ,value ,doc))) (defmacro defun-public (name arglist &body body) `(progn @@ -16,6 +19,8 @@ (write-line "You have modified files. Please stash or commit your files before proceeding.") ,@body)) +(defvar-public *grep* "findstr" "The name of the program used for searching. On Windows this is set to \'findstr\', but it may be changed to \'grep\' for Unix systems.") + (defun remove-empty (text-lines) "Removes every empty line from a list of lines of text" (remove-if #'str:emptyp text-lines)) @@ -31,6 +36,7 @@ (run-command (str:join " " (cons "git" arguments)))) (defun-public help () + "Lists every public command. Use (describe 'command-name) for documentation." (do-external-symbols (sym) (format t "~a~%" sym)))