aboutsummaryrefslogtreecommitdiff
path: root/lib/util.lisp
diff options
context:
space:
mode:
authorColin Okay <okay@toyful.space>2022-03-12 14:17:17 -0600
committerColin Okay <okay@toyful.space>2022-03-12 14:17:17 -0600
commit8fba7071223fb6744407789c1b1ae5a4549779e5 (patch)
tree4ec5fd7d2e07877ce6020e268499d0119d2ae735 /lib/util.lisp
parent6d706967f1de63de80c83766053e896ab4792420 (diff)
built and ran refactored client app
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"))
+