Check bookmark doesn't exist before inserting
The `add' command checks if the given url has been registered before and if so will print a message about this.
This commit is contained in:
parent
6f5171c1ca
commit
6121891396
1 changed files with 5 additions and 3 deletions
|
@ -196,9 +196,11 @@ bookmark."
|
||||||
|
|
||||||
Add URL with NAME, DESCRIPTION and TAGS to the database. TAGS may be
|
Add URL with NAME, DESCRIPTION and TAGS to the database. TAGS may be
|
||||||
omitted or any number of tag names."
|
omitted or any number of tag names."
|
||||||
(with-transaction *db*
|
(if (not (bookmark-exists-p url))
|
||||||
(insert-bookmark url name description)
|
(with-transaction *db*
|
||||||
(add-tags (last-insert-rowid *db*) tags)))
|
(insert-bookmark url name description)
|
||||||
|
(add-tags (last-insert-rowid *db*) tags))
|
||||||
|
(format t "~A has already been bookmarked~%" url)))
|
||||||
|
|
||||||
(defcommand edit (url &rest rest)
|
(defcommand edit (url &rest rest)
|
||||||
"Edit a bookmark."
|
"Edit a bookmark."
|
||||||
|
|
Loading…
Reference in a new issue