Disable -t for --title

This commit is contained in:
Arun Prakash Jana 2017-03-16 23:45:37 +05:30
parent 0d87104679
commit 46e2e4a704
No known key found for this signature in database
GPG Key ID: A75979F35C080412
6 changed files with 15 additions and 15 deletions

View File

@ -172,7 +172,7 @@ EDIT OPTIONS:
--tag [+|-] [...] comma-separated tags --tag [+|-] [...] comma-separated tags
clear bookmark tagset, if no arguments clear bookmark tagset, if no arguments
'+' appends to, '-' removes from tagset '+' appends to, '-' removes from tagset
-t, --title [...] bookmark title; if no arguments: --title [...] bookmark title; if no arguments:
-a: do not set title, -u: clear title -a: do not set title, -u: clear title
-c, --comment [...] description of the bookmark -c, --comment [...] description of the bookmark
clears description, if no arguments clears description, if no arguments
@ -302,7 +302,7 @@ The following steps explore the procedure on Linux with Ubuntu as the reference
#### Test drive #### Test drive
Copy or select a URL with mouse and press the keyboard shortcut to add it to the `buku` database. The addition might take a few seconds to reflect depending on your internet speed and the time `buku` needs to fetch the title from the URL. To avoid title fetch from the web, add the `-t` option to the script. Copy or select a URL with mouse and press the keyboard shortcut to add it to the `buku` database. The addition might take a few seconds to reflect depending on your internet speed and the time `buku` needs to fetch the title from the URL. To avoid title fetch from the web, add the `--title` option to the script.
To verify that the bookmark has indeed been added, run: To verify that the bookmark has indeed been added, run:
@ -377,14 +377,14 @@ The first command picks editor from the environment variable `EDITOR`. The secon
where, >: title, +: comment, #: tags where, >: title, +: comment, #: tags
3. **Add** a bookmark with tags `search engine` & `privacy` and **immutable custom title** `DDG`: 3. **Add** a bookmark with tags `search engine` & `privacy` and **immutable custom title** `DDG`:
$ buku -a https://ddg.gg search engine, privacy -t 'DDG' --immutable 1 $ buku -a https://ddg.gg search engine, privacy --title 'DDG' --immutable 1
336. https://ddg.gg (L) 336. https://ddg.gg (L)
> DDG > DDG
# privacy,search engine # privacy,search engine
Note that URL must precede tags. Note that URL must precede tags.
4. **Add** a bookmark **without a title** (works for update too): 4. **Add** a bookmark **without a title** (works for update too):
$ buku -a https://ddg.gg search engine, privacy -t $ buku -a https://ddg.gg search engine, privacy --title
5. **Edit and update** a bookmark from editor: 5. **Edit and update** a bookmark from editor:
$ buku -w 15012014 $ buku -w 15012014

View File

@ -36,10 +36,10 @@ _buku () {
--shorten --shorten
--sreg --sreg
--stag --stag
-t --title
--tacit --tacit
--tag --tag
--threads --threads
--title
-u --update -u --update
--url --url
-V -V

View File

@ -29,10 +29,10 @@ complete -c buku -s S -l sall -r --description 'match all keywords'
complete -c buku -l shorten -r --description 'shorten a URL using tny.im' complete -c buku -l shorten -r --description 'shorten a URL using tny.im'
complete -c buku -l sreg -r --description 'match a regular expression' complete -c buku -l sreg -r --description 'match a regular expression'
complete -c buku -l stag --description 'search by tag or show tags' complete -c buku -l stag --description 'search by tag or show tags'
complete -c buku -s t -l title --description 'set custom title'
complete -c buku -l tacit --description 'reduce verbosity' complete -c buku -l tacit --description 'reduce verbosity'
complete -c buku -l tag --description 'set tags, use + to append, - to remove' complete -c buku -l tag --description 'set tags, use + to append, - to remove'
complete -c buku -l threads -r --description 'max connections for full refresh' complete -c buku -l threads -r --description 'max connections for full refresh'
complete -c buku -l title --description 'set custom title'
complete -c buku -s u -l update --description 'update bookmark' complete -c buku -s u -l update --description 'update bookmark'
complete -c buku -l url -r --description 'set url' complete -c buku -l url -r --description 'set url'
complete -c buku -s V --description 'check latest upstream release' complete -c buku -s V --description 'check latest upstream release'

View File

@ -34,10 +34,10 @@ args=(
'(--shorten)--shorten[shorten a URL using tny.im]:index/url' '(--shorten)--shorten[shorten a URL using tny.im]:index/url'
'(--sreg)--sreg[match a regular exression]:regex' '(--sreg)--sreg[match a regular exression]:regex'
'(--stag)--stag[search by tag or show tags]' '(--stag)--stag[search by tag or show tags]'
'(-t --title)'{-t,--title}'[set custom title]'
'(--tacit)--tacit[reduce verbosity]' '(--tacit)--tacit[reduce verbosity]'
'(--tag)--tag[set tags, use + to append, - to remove]' '(--tag)--tag[set tags, use + to append, - to remove]'
'(--threads)--threads[max connections for full refresh]:value' '(--threads)--threads[max connections for full refresh]:value'
'(--title)--title[set custom title]'
'(-u --update)'{-u,--update}'[update bookmark]' '(-u --update)'{-u,--update}'[update bookmark]'
'(--url)--url[set url]:url' '(--url)--url[set url]:url'
'(-V)-V[check latest upstream release]' '(-V)-V[check latest upstream release]'

6
buku.1
View File

@ -111,7 +111,7 @@ Specify the URL, works with --update only. Fetches and updates title if --title
.BI \--tag " [+|-] [...]" .BI \--tag " [+|-] [...]"
Specify comma separated tags, works with --add, --update. Clears the tags, if no arguments passed. Appends or deletes tags, if list of tags is preceded by '+' or '-' respectively. Specify comma separated tags, works with --add, --update. Clears the tags, if no arguments passed. Appends or deletes tags, if list of tags is preceded by '+' or '-' respectively.
.TP .TP
.BI \-t " " \--title " [...]" .BI \--title " [...]"
Manually specify the title, works with --add, --update. Omits or clears the title, if no arguments passed. Manually specify the title, works with --add, --update. Omits or clears the title, if no arguments passed.
.TP .TP
.BI \-c " " \--comment " [...]" .BI \-c " " \--comment " [...]"
@ -327,7 +327,7 @@ In the output, >: title, +: comment, #: tags.
.PP .PP
.EX .EX
.IP .IP
.B buku -a https://ddg.gg search engine, privacy -t 'DDG' --immutable 1 .B buku -a https://ddg.gg search engine, privacy --title 'DDG' --immutable 1
.EE .EE
.PP .PP
.IP "" 4 .IP "" 4
@ -338,7 +338,7 @@ Note that URL must precede tags.
.PP .PP
.EX .EX
.IP .IP
.B buku -a https://ddg.gg search engine, privacy -t .B buku -a https://ddg.gg search engine, privacy --title
.EE .EE
.PP .PP
.IP 5. 4 .IP 5. 4

10
buku.py
View File

@ -713,9 +713,9 @@ class BukuDb:
# Update title # Update title
# #
# 1. if -t has no arguments, delete existing title # 1. if --title has no arguments, delete existing title
# 2. if -t has arguments, update existing title # 2. if --title has arguments, update existing title
# 3. if -t option is omitted at cmdline: # 3. if --title option is omitted at cmdline:
# if URL is passed, update the title from web using the URL # if URL is passed, update the title from web using the URL
# 4. if no other argument (url, tag, comment, immutable) passed, # 4. if no other argument (url, tag, comment, immutable) passed,
# update title from web using DB URL (if title is mutable) # update title from web using DB URL (if title is mutable)
@ -2568,7 +2568,7 @@ POSITIONAL ARGUMENTS:
--tag [+|-] [...] comma-separated tags --tag [+|-] [...] comma-separated tags
clear bookmark tagset, if no arguments clear bookmark tagset, if no arguments
'+' appends to, '-' removes from tagset '+' appends to, '-' removes from tagset
-t, --title [...] bookmark title; if no arguments: --title [...] bookmark title; if no arguments:
-a: do not set title, -u: clear title -a: do not set title, -u: clear title
-c, --comment [...] description of the bookmark -c, --comment [...] description of the bookmark
clears description, if no arguments clears description, if no arguments
@ -2577,7 +2577,7 @@ POSITIONAL ARGUMENTS:
addarg = edit_grp.add_argument addarg = edit_grp.add_argument
addarg('--url', nargs=1, help=HIDE) addarg('--url', nargs=1, help=HIDE)
addarg('--tag', nargs='*', help=HIDE) addarg('--tag', nargs='*', help=HIDE)
addarg('-t', '--title', nargs='*', help=HIDE) addarg('--title', nargs='*', help=HIDE)
addarg('-c', '--comment', nargs='*', help=HIDE) addarg('-c', '--comment', nargs='*', help=HIDE)
addarg('--immutable', type=int, default=-1, choices={0, 1}, help=HIDE) addarg('--immutable', type=int, default=-1, choices={0, 1}, help=HIDE)