Change -o option to -w.

Signed-off-by: Arun Prakash Jana <engineerarun@gmail.com>
This commit is contained in:
Arun Prakash Jana 2015-11-10 14:01:35 +05:30
parent 2bc5172acd
commit 5b38f11b1a
3 changed files with 11 additions and 11 deletions

View File

@ -14,7 +14,7 @@ If you find `markit` useful, please consider donating via PayPal.
# Features # Features
- Add, update or remove a bookmark - Add, update or remove a bookmark
- Add tags to bookmarks - Add tags to bookmarks
- Optionally fetch page title data from the web (default: disabled, use `-o`) - Optionally fetch page title data from the web (default: disabled, use `-w`)
- Use (partial) tags or keywords to search bookmarks - Use (partial) tags or keywords to search bookmarks
- Unique URLs to avoid duplicates, show index if URL already exists - Unique URLs to avoid duplicates, show index if URL already exists
- Open search results in browser - Open search results in browser
@ -73,11 +73,11 @@ Options
-d N delete entry at index N -d N delete entry at index N
-D delete ALL bookmarks -D delete ALL bookmarks
-i N add entry at index N, works with -a, use to fill deleted index -i N add entry at index N, works with -a, use to fill deleted index
-o fetch title info from web, works with -a or -u
-p N show details of bookmark record at index N -p N show details of bookmark record at index N
-P show all bookmarks along with real index from database -P show all bookmarks along with real index from database
-s keyword(s) search all bookmarks for a (partial) tag or each keyword -s keyword(s) search all bookmarks for a (partial) tag or each keyword
-u N update entry at index N (from output of -p) -u N update entry at index N (from output of -p)
-w fetch title info from web, works with -a or -u
-z show debug information -z show debug information
you can either add or update or delete in one instance you can either add or update or delete in one instance
any other option shows help and exits markit any other option shows help and exits markit
@ -91,11 +91,11 @@ Keys
Added at index 15012014</pre> Added at index 15012014</pre>
The assigned automatic index 15012014 is unique, one greater than highest index already in use in database. The assigned automatic index 15012014 is unique, one greater than highest index already in use in database.
2. Add a bookmark, fetch page Title information from web: 2. Add a bookmark, fetch page Title information from web:
<pre>$ markit -a -o http://tuxdiary.com linux news, open source <pre>$ markit -a -w http://tuxdiary.com linux news, open source
Title: [TuxDiary | Linux, open source and a pinch of leisure.] Title: [TuxDiary | Linux, open source and a pinch of leisure.]
Added at index 15012014</pre> Added at index 15012014</pre>
3. Update existing bookmark at index 15012014 with a new tag: 3. Update existing bookmark at index 15012014 with a new tag:
<pre>$ markit -u 15012014 -o http://tuxdiary.com linux news, open source, magazine <pre>$ markit -u 15012014 -w http://tuxdiary.com linux news, open source, magazine
Title: [TuxDiary | Linux, open source and a pinch of leisure.] Title: [TuxDiary | Linux, open source and a pinch of leisure.]
Updated</pre> Updated</pre>
4. Delete bookmark at index 15012014: 4. Delete bookmark at index 15012014:
@ -103,7 +103,7 @@ Updated</pre>
5. Delete all bookmarks: 5. Delete all bookmarks:
<pre>$ markit -D</pre> <pre>$ markit -D</pre>
6. Insert a bookmark at deleted index 15012014 (fails if index or URL exists in database): 6. Insert a bookmark at deleted index 15012014 (fails if index or URL exists in database):
<pre>$ markit -i 15012014 -a -o http://tuxdiary.com/about linux news, open source <pre>$ markit -i 15012014 -a -w http://tuxdiary.com/about linux news, open source
Title: [A journey with WordPress | TuxDiary] Title: [A journey with WordPress | TuxDiary]
Added at index 15012014</pre> Added at index 15012014</pre>
This option is useful in filling deleted indices from database manually. This option is useful in filling deleted indices from database manually.

6
markit
View File

@ -51,11 +51,11 @@ def usage():
print(" -d N delete entry at index N") print(" -d N delete entry at index N")
print(" -D delete ALL bookmarks") print(" -D delete ALL bookmarks")
print(" -i N add entry at index N, works with -a, use to fill deleted index") print(" -i N add entry at index N, works with -a, use to fill deleted index")
print(" -o fetch title info from web, works with -a or -u")
print(" -p N show details of bookmark record at index N") print(" -p N show details of bookmark record at index N")
print(" -P show all bookmarks along with real index from database") print(" -P show all bookmarks along with real index from database")
print(" -s keyword(s) search all bookmarks for a (partial) tag or each keyword") print(" -s keyword(s) search all bookmarks for a (partial) tag or each keyword")
print(" -u N update entry at index N (from output of -p)") print(" -u N update entry at index N (from output of -p)")
print(" -w fetch title info from web, works with -a or -u")
print(" -z show debug information") print(" -z show debug information")
print(" you can either add or update or delete in one instance") print(" you can either add or update or delete in one instance")
print(" any other option shows help and exits markit\n") print(" any other option shows help and exits markit\n")
@ -375,7 +375,7 @@ if len(sys.argv) < 2:
# Check cmdline options # Check cmdline options
try: try:
optlist, keywords = getopt(sys.argv[1:], "d:i:p:u:aDoPsz") optlist, keywords = getopt(sys.argv[1:], "d:i:p:u:aDPswz")
if len(optlist) < 1: if len(optlist) < 1:
usage() usage()
@ -412,7 +412,7 @@ try:
addindex = opt[1] addindex = opt[1]
if int(addindex) <= 0: if int(addindex) <= 0:
usage() usage()
elif opt[0] == "-o": elif opt[0] == "-w":
online = True online = True
elif opt[0] == "-p": elif opt[0] == "-p":
if not opt[1].isdigit(): if not opt[1].isdigit():

View File

@ -43,9 +43,6 @@ Add a new record at index
.I N .I N
of the database. Works only if `-a` option is used. Use this option to fill blank indexes left by deleted bookmarks. of the database. Works only if `-a` option is used. Use this option to fill blank indexes left by deleted bookmarks.
.TP .TP
.BI \-o
Fetch title data from the web. Works only with `-a` or `-u` options.
.TP
.BI \-p " N" .BI \-p " N"
Show details of bookmark record stored at Show details of bookmark record stored at
.I Nth .I Nth
@ -62,6 +59,9 @@ Update bookmark at index
.I N .I N
(as shown in `-p` output). (as shown in `-p` output).
.TP .TP
.BI \-w
Fetch title data from the web. Works only with `-a` or `-u` options.
.TP
.BI \-z .BI \-z
Enable debugging. Enable debugging.
.TP .TP