aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--app/app.lisp2
-rw-r--r--lib/client.lisp8
2 files changed, 4 insertions, 6 deletions
diff --git a/app/app.lisp b/app/app.lisp
index 8e89a93..01a88ca 100644
--- a/app/app.lisp
+++ b/app/app.lisp
@@ -232,7 +232,7 @@ than the users."
(:new
(cli:add-new-oneliner))
(:edit
- (cli:edit-item id-or-name))
+ (cli:edit-item id-or-name (getopt :long-name "draft")))
(:publish
(cli::publish-draft id-or-name))
(:flag
diff --git a/lib/client.lisp b/lib/client.lisp
index a72b991..6883b20 100644
--- a/lib/client.lisp
+++ b/lib/client.lisp
@@ -195,11 +195,9 @@ running the body. If such a oneliner can be found."
;;; EDITING ONELINERS
-(defun edit-item (ident)
+(defun edit-item (ident &optional draftp)
(api-token) ;; fails with error if not set.
- (when-oneliner (ol ident)
- ;; Like adding a oneliner, read each field in from a prompt.
- ;; Here, prefil the field with its current value.
+ (let ((ol (if draftp (fetch-draft ident) (the-oneliner ident))))
(let* ((oneliner-string
(prompt "Oneliner: "
:expect 'valid-oneliner-string-p
@@ -270,7 +268,7 @@ running the body. If such a oneliner can be found."
(:body (oneliner-to-json-body local)
:content-type "application/json")
(api:patch--oneliner-entry-edit (oneliner-id ol) :token (api-token))
- ;(merge-oneliners (list new-item)) ;;TODO: this is broken, wait for API update.
+ ;(merge-oneliners (list new-item)) ;;TODO: this is broken, wait for API update.
(format t "Edits accepted~%")))))))
(defun publish-draft (name)