aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/oneliner.lisp5
-rw-r--r--lib/state.lisp4
-rw-r--r--lib/util.lisp7
3 files changed, 14 insertions, 2 deletions
diff --git a/lib/oneliner.lisp b/lib/oneliner.lisp
index 668a82c..8386fa9 100644
--- a/lib/oneliner.lisp
+++ b/lib/oneliner.lisp
@@ -75,7 +75,7 @@
(let* ((title-line-format-str
(concatenate 'string "~" (prin1-to-string *term-width*) "<[~a]~;~a~;~a~>~%"))
(tags-line-format-string
- (concatenate 'string "~" (prin1-to-string *term-width*) "<~a~;by ~a~>~%")))
+ (concatenate 'string "~" (prin1-to-string *term-width*) "<~a~;by ~a ~a~>~%")))
(loop repeat *term-width* do (princ #\_))
(terpri)
(format t title-line-format-str
@@ -87,7 +87,8 @@
(equalp "manual" (oneliner-runstyle ol))))
(format t tags-line-format-string
(format nil "tags: ~{~a~^ ~}" (oneliner-tags ol))
- (oneliner-createdby ol))
+ (oneliner-createdby ol)
+ (datestring-of-universal-time (oneliner-createdat ol)))
(loop
for x from 0 to (length (oneliner-brief ol)) by *term-width*
do (format t "~a~%"
diff --git a/lib/state.lisp b/lib/state.lisp
index 5ca5a7b..49cd5d8 100644
--- a/lib/state.lisp
+++ b/lib/state.lisp
@@ -179,5 +179,9 @@ sets the api's *host* variable. If BODY produces no errors, the "
(write-drafts-to-disk)
(write-cache-to-disk)
(write-config-to-disk))
+ (dexador.error:http-request-failed (e)
+ (format *error-output* "Operation failed. The server at ~a returned with ~a~%"
+ api:*host*
+ (dexador.error:response-status e)))
(error (e)
(format *error-output* "~a~%" e)))))
diff --git a/lib/util.lisp b/lib/util.lisp
index 4b827f1..441b2e0 100644
--- a/lib/util.lisp
+++ b/lib/util.lisp
@@ -71,6 +71,12 @@ determined by EXECUTABLE-ON-SYSTEM-P."
(if what "true" "false"))
+(defun datestring-of-universal-time (ut)
+ (multiple-value-bind
+ (sec min hour day month year) (decode-universal-time ut)
+ (declare (ignore sec min hour))
+ (format nil "~a-~2,'0d-~2,'0d" year month day)))
+
(defmacro defplist (name &rest slots)
(let* ((slots-names
(loop for slot in slots
@@ -92,3 +98,4 @@ determined by EXECUTABLE-ON-SYSTEM-P."
`(progn
,make-name-defun
,@slot-defuns)))
+