aboutsummaryrefslogtreecommitdiff
path: root/src/lib.lisp
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib.lisp')
-rw-r--r--src/lib.lisp12
1 files changed, 9 insertions, 3 deletions
diff --git a/src/lib.lisp b/src/lib.lisp
index 68629e6..9fd75a8 100644
--- a/src/lib.lisp
+++ b/src/lib.lisp
@@ -195,9 +195,15 @@ and, failing that, try to fetch from configured server."
(with-oneliner (ol name-or-number)
(set-term-width)
(print-oneliner-result-for-user ol)
- (when (getf ol :explanation)
- (princ #\newline)
- (princ (getf ol :explanation)))))
+ (a:when-let (explanation (getf ol :explanation))
+ (format t "EXPLANATION:~%~%")
+ (princ
+ (string-trim
+ '(#\newline #\space #\tab)
+ (if (str:starts-with? (getf ol :oneliner) explanation)
+ (subseq explanation (length (getf ol :oneliner)))
+ explanation)))
+ (terpri))))
;;; API REQUEST FUNCTIONS