aboutsummaryrefslogtreecommitdiff
path: root/lib/util.lisp
diff options
context:
space:
mode:
Diffstat (limited to 'lib/util.lisp')
-rw-r--r--lib/util.lisp9
1 files changed, 9 insertions, 0 deletions
diff --git a/lib/util.lisp b/lib/util.lisp
index 2a6d456..27f389e 100644
--- a/lib/util.lisp
+++ b/lib/util.lisp
@@ -46,6 +46,14 @@ the directories that appear in the value of that variable."
thereis (uiop:file-exists-p
(make-pathname :name name :directory directory))))
+(defun parse-oneliner-tags (string)
+ "Splits a string using consequtive whitespace as a separator, and
+returns a set of strings that name executable system commands, as
+determined by EXECUTABLE-ON-SYSTEM-P."
+ (remove-duplicates
+ (remove-if-not #'executable-on-system-p (ppcre:split " +" string))
+ :test #'equal))
+
(defun print-to-file (printable-object pathname &optional (if-exists :supersede))
"Prints an object to a file, ensuring that the containing directory exists first."
(ensure-directories-exist pathname)
@@ -61,3 +69,4 @@ the directories that appear in the value of that variable."
(defun true-or-false (what)
"Returns the strings \"true\" or \"false\" depending on whehter or not WHAT is null"
(if what "true" "false"))
+