Support browsing at prompt
This commit is contained in:
parent
2c8022902b
commit
fe2d4653c1
3
buku.1
3
buku.1
@ -271,6 +271,9 @@ Search bookmarks by a tag. List all tags alphabetically, if no arguments. The in
|
|||||||
.BI "g" " [...][>>|>|<<][...]"
|
.BI "g" " [...][>>|>|<<][...]"
|
||||||
Append, remove tags to/from indices and/or ranges.
|
Append, remove tags to/from indices and/or ranges.
|
||||||
.TP
|
.TP
|
||||||
|
.BI "o" " [...]"
|
||||||
|
Browse bookmarks by indices and/or ranges.
|
||||||
|
.TP
|
||||||
.BI "p" " [...]"
|
.BI "p" " [...]"
|
||||||
Print bookmarks by indices and/or ranges.
|
Print bookmarks by indices and/or ranges.
|
||||||
.TP
|
.TP
|
||||||
|
24
buku.py
24
buku.py
@ -1834,6 +1834,7 @@ keys:
|
|||||||
r expression run a regex search
|
r expression run a regex search
|
||||||
t [...] search bookmarks by a tag or show tag list
|
t [...] search bookmarks by a tag or show tag list
|
||||||
g [...][>>|>|<<][...] append, remove tags to/from indices and/or ranges
|
g [...][>>|>|<<][...] append, remove tags to/from indices and/or ranges
|
||||||
|
o [...] browse bookmarks by indices and/or ranges
|
||||||
p [...] print bookmarks by indices and/or ranges
|
p [...] print bookmarks by indices and/or ranges
|
||||||
w [editor|index] edit and add or update a bookmark
|
w [editor|index] edit and add or update a bookmark
|
||||||
(tag list index fetches bookmarks by tag)
|
(tag list index fetches bookmarks by tag)
|
||||||
@ -2146,7 +2147,8 @@ def taglist_subprompt(obj, msg, noninteractive=False):
|
|||||||
elif (nav == 'q' or nav == 'd' or nav == '?' or
|
elif (nav == 'q' or nav == 'd' or nav == '?' or
|
||||||
nav.startswith('s ') or nav.startswith('S ') or
|
nav.startswith('s ') or nav.startswith('S ') or
|
||||||
nav.startswith('r ') or nav.startswith('t ') or
|
nav.startswith('r ') or nav.startswith('t ') or
|
||||||
nav.startswith('g ') or nav.startswith('p ')):
|
nav.startswith('o ') or nav.startswith('p ') or
|
||||||
|
nav.startswith('g ')):
|
||||||
return nav
|
return nav
|
||||||
elif nav == 'w' or nav.startswith('w '):
|
elif nav == 'w' or nav.startswith('w '):
|
||||||
edit_at_prompt(obj, nav)
|
edit_at_prompt(obj, nav)
|
||||||
@ -2281,11 +2283,23 @@ def prompt(obj, results, noninteractive=False, deep=False, subprompt=False):
|
|||||||
obj.print_rec(int(id))
|
obj.print_rec(int(id))
|
||||||
elif '-' in id:
|
elif '-' in id:
|
||||||
vals = [int(x) for x in id.split('-')]
|
vals = [int(x) for x in id.split('-')]
|
||||||
if vals[0] > vals[-1]:
|
obj.print_rec(0, vals[0], vals[-1], True)
|
||||||
vals[0], vals[-1] = vals[-1], vals[0]
|
else:
|
||||||
|
print('Invalid input')
|
||||||
|
except ValueError:
|
||||||
|
print('Invalid input')
|
||||||
|
continue
|
||||||
|
|
||||||
for _id in range(vals[0], vals[-1] + 1):
|
# Browse bookmarks by DB index
|
||||||
obj.print_rec(_id)
|
if nav.startswith('o '):
|
||||||
|
id_list = nav[2:].split()
|
||||||
|
try:
|
||||||
|
for id in id_list:
|
||||||
|
if is_int(id):
|
||||||
|
obj.browse_by_index(int(id))
|
||||||
|
elif '-' in id:
|
||||||
|
vals = [int(x) for x in id.split('-')]
|
||||||
|
obj.browse_by_index(0, vals[0], vals[-1], True)
|
||||||
else:
|
else:
|
||||||
print('Invalid input')
|
print('Invalid input')
|
||||||
except ValueError:
|
except ValueError:
|
||||||
|
@ -47,6 +47,7 @@ keys:
|
|||||||
r expression run a regex search
|
r expression run a regex search
|
||||||
t [...] search bookmarks by a tag or show tag list
|
t [...] search bookmarks by a tag or show tag list
|
||||||
g [...][>>|>|<<][...] append, remove tags to/from indices and/or ranges
|
g [...][>>|>|<<][...] append, remove tags to/from indices and/or ranges
|
||||||
|
o [...] browse bookmarks by indices and/or ranges
|
||||||
p [...] print bookmarks by indices and/or ranges
|
p [...] print bookmarks by indices and/or ranges
|
||||||
w [editor|index] edit and add or update a bookmark
|
w [editor|index] edit and add or update a bookmark
|
||||||
(tag list index fetches bookmarks by tag)
|
(tag list index fetches bookmarks by tag)
|
||||||
|
Loading…
Reference in New Issue
Block a user