diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/package.lisp | 1 | ||||
-rw-r--r-- | src/util.lisp | 5 |
2 files changed, 6 insertions, 0 deletions
diff --git a/src/package.lisp b/src/package.lisp index 0ea8241..3819017 100644 --- a/src/package.lisp +++ b/src/package.lisp @@ -105,6 +105,7 @@ #:unlines #:words #:unwords + #:strip-prefix #:memstr= #:define-simple-error #:plist-to-long-options diff --git a/src/util.lisp b/src/util.lisp index d123e8c..e20b113 100644 --- a/src/util.lisp +++ b/src/util.lisp @@ -72,6 +72,11 @@ (defun unwords (words) (format nil "~{~A~^ ~}" words)) +(defun strip-prefix (prefix string) + "If STRING is prefixed by PREFIX, return the rest of STRING, +otherwise return NIL." + (nth-value 1 (starts-with-subseq prefix string :return-suffix t))) + (defun memstr= (string list) (member string list :test #'string=)) |