Add a bookmark-del command.

This commit is contained in:
Florian Bruhin 2015-07-26 21:05:32 +02:00
parent 0acd1b8dc8
commit 093b3cba25

View File

@ -255,3 +255,16 @@ class BookmarkManager(UrlMarkManager):
self.changed.emit() self.changed.emit()
self.added.emit(title, urlstr) self.added.emit(title, urlstr)
message.info(win_id, "Bookmark added") message.info(win_id, "Bookmark added")
@cmdutils.register(instance='bookmark-manager', maxsplit=0,
completion=[usertypes.Completion.bookmark_by_url])
def bookmark_del(self, url):
"""Delete a bookmark.
Args:
url: The URL of the bookmark to delete.
"""
try:
self.delete(url)
except KeyError:
raise cmdexc.CommandError("Bookmark '{}' not found!".format(url))