Documentation update.

This commit is contained in:
Arun Prakash Jana 2016-11-26 19:58:22 +05:30
parent 6beed4e183
commit 314ee1c840
3 changed files with 50 additions and 45 deletions

View File

@ -141,17 +141,16 @@ Shell completion scripts for Bash, Fish and Zsh can be found in respective subdi
-d, --delete [...] delete bookmarks. Valid inputs: either
a hyphenated single range (100-200),
OR space-separated indices (100 15 200)
delete search results with search options
delete results with search options
delete all bookmarks, if no arguments
-h, --help show this information and exit
edit options:
--url keyword specify url, works with -u only
--tag [+|-] [...] set comma-separated tags
--url keyword specify url, works only with -u option
--tag [+|-] [...] set comma-separated tags with -a and -u
clear tags, if no arguments
works with -a, -u
append specified tags, if preceded by '+'
remove specified tags, if preceded by '-'
append to tags, if preceded by '+'
remove from tags, if preceded by '-'
-t, --title [...] manually set title, works with -a, -u
if no arguments:
-a: do not set title, -u: clear title
@ -393,44 +392,47 @@ The last index is moved to the deleted index to keep the DB compact.
17. List **all unique tags** alphabetically:
$ buku --stag
18. **Encrypt or decrypt** DB with **custom number of iterations** (15) to generate key:
18. Run a **search and delete** the results:
$ buku -s kernel debugging -d
19. **Encrypt or decrypt** DB with **custom number of iterations** (15) to generate key:
$ buku -l 15
$ buku -k 15
The same number of iterations must be specified for one lock & unlock instance. Default is 8, if omitted.
19. **Show details** of bookmark at index 15012014 and ranges 20-30, 40-50:
20. **Show details** of bookmarks at index 15012014 and ranges 20-30, 40-50:
$ buku -p 20-30 15012014 40-50
20. **Show all** bookmarks with real index from database:
21. **Show all** bookmarks with real index from database:
$ buku -p
$ buku -p | more
21. **Replace tag** 'old tag' with 'new tag':
22. **Replace tag** 'old tag' with 'new tag':
$ buku -r 'old tag' new tag
22. **Delete tag** 'old tag' from DB:
23. **Delete tag** 'old tag' from DB:
$ buku -r 'old tag'
23. **Append (or delete) tags** 'tag 1', 'tag 2' to (or from) existing tags of bookmark at index 15012014:
24. **Append (or delete) tags** 'tag 1', 'tag 2' to (or from) existing tags of bookmark at index 15012014:
$ buku -u 15012014 --tag + tag 1, tag 2
$ buku -u 15012014 --tag - tag 1, tag 2
24. **Open URL** at index 15012014 in browser:
25. **Open URL** at index 15012014 in browser:
$ buku -o 15012014
25. List bookmarks with **no title or tags** for bookkeeping:
26. List bookmarks with **no title or tags** for bookkeeping:
$ buku -S blank
26. List bookmarks with **immutable title**:
27. List bookmarks with **immutable title**:
$ buku -S immutable
27. **Shorten URL** www.google.com and the URL at index 20:
28. **Shorten URL** www.google.com and the URL at index 20:
$ buku --shorten www.google.com
$ buku --shorten 20
28. More **help**:
29. More **help**:
$ buku
$ buku -h
$ man buku
## Contributions

25
buku.1
View File

@ -381,6 +381,13 @@ List \fBall unique tags\fR alphabetically:
.B buku --stag
.PP
.IP 18. 4
Run a \fBsearch and delete\fR the results:
.PP
.EX
.IP
.B buku -s kernel debugging -d
.PP
.IP 19. 4
\fBEncrypt or decrypt\fR DB with \fBcustom number of iterations\fR (15) to generate key:
.PP
.EX
@ -393,14 +400,14 @@ List \fBall unique tags\fR alphabetically:
.IP "" 4
The same number of iterations must be specified for one lock & unlock instance. Default is 8, if omitted.
.PP
.IP 19. 4
.IP 20. 4
\fBShow details\fR of bookmarks at index 15012014 and ranges 20-30, 40-50:
.PP
.EX
.IP
.B buku -p 20-30 15012014 40-50
.PP
.IP 20. 4
.IP 21. 4
\fBShow all\fR bookmarks with real index from database:
.PP
.EX
@ -408,21 +415,21 @@ The same number of iterations must be specified for one lock & unlock instance.
.B buku -p
.B buku -p | more
.PP
.IP 21. 4
.IP 22. 4
\fBReplace tag\fR 'old tag' with 'new tag':
.PP
.EX
.IP
.B buku -r 'old tag' new tag
.PP
.IP 22. 4
.IP 23. 4
\fBDelete tag\fR 'old tag' from DB:
.PP
.EX
.IP
.B buku -r 'old tag'
.PP
.IP 23. 4
.IP 24. 4
\fBAppend (or delete) tags\fR 'tag 1', 'tag 2' to (or from) existing tags of bookmark at index 15012014:
.PP
.EX
@ -430,28 +437,28 @@ The same number of iterations must be specified for one lock & unlock instance.
.B buku -u 15012014 --tag + tag 1, tag 2
.B buku -u 15012014 --tag - tag 1, tag 2
.PP
.IP 24. 4
.IP 25. 4
\fBOpen URL\fR at index 15012014 in browser:
.PP
.EX
.IP
.B buku -o 15012014
.PP
.IP 25. 4
.IP 26. 4
List bookmarks with \fBno title or tags\fR for bookkeeping:
.PP
.EX
.IP
.B buku -S blank
.PP
.IP 26. 4
.IP 27. 4
List bookmarks with \fBimmutable title\fR:
.PP
.EX
.IP
.B buku -S immutable
.PP
.IP 27. 4
.IP 28. 4
\fBShorten\fR the URL www.google.com and the URL at index 20:
.PP
.EX

32
buku.py
View File

@ -2178,7 +2178,7 @@ def main():
-d, --delete [...] delete bookmarks. Valid inputs: either
a hyphenated single range (100-200),
OR space-separated indices (100 15 200)
delete search results with search options
delete results with search options
delete all bookmarks, if no arguments
-h, --help show this information and exit''')
addarg = general_grp.add_argument
@ -2193,12 +2193,12 @@ def main():
edit_grp = argparser.add_argument_group(
title='edit options',
description='''--url keyword specify url, works with -u only
--tag [+|-] [...] set comma-separated tags
description='''--url keyword specify url, works only with -u option
--tag [+|-] [...] set comma-separated tags with -a and -u
clear tags, if no arguments
works with -a, -u
append specified tags, if preceded by '+'
remove specified tags, if preceded by '-'
append to tags, if preceded by '+'
remove from tags, if preceded by '-'
-t, --title [...] manually set title, works with -a, -u
if no arguments:
-a: do not set title, -u: clear title
@ -2412,31 +2412,27 @@ def main():
# Search operations
search_results = None
search_opted = False
search_opted = True
# Search URLs, titles, tags for any keyword and delete if wanted
if args.sany is not None:
search_opted = True
# Search URLs, titles, tags for any keyword
search_results = bdb.searchdb(args.sany, False, args.deep)
# Search URLs, titles, tags with all keywords and delete if wanted
elif args.sall is not None:
search_opted = True
# Search URLs, titles, tags with all keywords
search_results = bdb.searchdb(args.sall, True, args.deep)
# Run a regular expression search
elif args.sreg is not None:
search_opted = True
# Run a regular expression search
search_results = bdb.searchdb(args.sreg, regex=True)
# Search bookmarks by tag and delete if wanted
elif tagsearch:
search_opted = True
# Search bookmarks by tag
if len(args.stag) > 0:
search_results = bdb.search_by_tag(' '.join(args.stag))
else:
# Use sub prompt to list all tags
prompt(bdb, None, subprompt=True)
search_opted = False
else:
search_opted = False
if search_results:
oneshot = args.noprompt
@ -2538,7 +2534,7 @@ def main():
bdb.close_quit(1)
bdb.browse_by_index(args.open)
# Shorten URL:
# Shorten URL
if args.shorten and len(args.shorten):
if is_int(args.shorten[0]):
shorturl = bdb.shorten_url(index=int(args.shorten[0]))