Show results before deleting them

This commit is contained in:
Arun Prakash Jana 2018-04-21 06:33:26 +05:30
parent 64972a9ed3
commit 554f86ea4c
No known key found for this signature in database
GPG Key ID: A75979F35C080412
2 changed files with 15 additions and 3 deletions

6
buku.1
View File

@ -344,14 +344,14 @@ If defined, will be used as the editor to edit bookmarks with option --write.
.TP
.BI https_proxy
If defined, will be used to access http and https resources through the configured proxy. Supported format:
.br
http[s]://[username:password@]proxyhost:proxyport/
.TP
.BI "GUI integration"
.B buku
can be integrated in a GUI environment with simple tweaks. Refer to:
can be integrated in a GUI environment with simple tweaks. Please refer to:
.br
.I https://github.com/jarun/Buku#gui-integration
.I https://github.com/jarun/Buku/wiki/System-integration
.SH COLORS
\fBbuku\fR allows you to customize the color scheme via a five-letter string, reminiscent of BSD \fBLSCOLORS\fR. The five letters represent the colors of
.IP - 2

12
buku.py
View File

@ -1365,6 +1365,12 @@ class BukuDb:
return self.cleardb()
try:
if self.chatty:
if self.print_rec(0, low, high, True) is True:
resp = input('Delete these bookmarks? (y/n): ')
if resp != 'y':
return False
query = 'DELETE from bookmarks where id BETWEEN ? AND ?'
self.cur.execute(query, (low, high))
print('Index %d-%d: %d deleted' % (low, high, self.cur.rowcount))
@ -1386,6 +1392,12 @@ class BukuDb:
return self.cleardb()
else: # Remove a single entry
try:
if self.chatty:
if self.print_rec(index) is True:
resp = input('Delete this bookmark? (y/n): ')
if resp != 'y':
return False
query = 'DELETE FROM bookmarks WHERE id = ?'
self.cur.execute(query, (index,))
if self.cur.rowcount == 1: