From 2266cdacdbb1db1a00adf7ac78458ac5f3741974 Mon Sep 17 00:00:00 2001 From: Saba Saba Date: Thu, 9 Feb 2023 12:26:18 -0500 Subject: [PATCH] Exposing *grep* publicly. --- git-repl.cl | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) 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))) -- 2.20.1