Add comment in Json output.

This commit is contained in:
Arun Prakash Jana 2016-05-19 00:45:57 +05:30
parent 450247af05
commit 8c7ef3ec34
No known key found for this signature in database
GPG Key ID: C0A712ED95043DCB
3 changed files with 5 additions and 4 deletions

View File

@ -153,7 +153,7 @@ Shell completion scripts for Bash, Fish and Zsh can be found in respective subdi
-r, --replace oldtag [newtag ...]
replace oldtag with newtag in all bookmarks
delete oldtag, if no newtag
-j, --json Json formatted output, works with -p, -s
-j, --json Json formatted output, for -p, -s, -S, --st
-o, --open N open bookmark at DB index N in web browser
-z, --debug show debug information and additional logs

5
buku
View File

@ -701,7 +701,7 @@ def formatJson(resultset, single=False):
elif showOpt == 2:
record = { 'url': row[1], 'tags': row[3][1:-1] }
else:
record = { 'url': row[1], 'title': row[2], 'tags': row[3][1:-1]}
record = { 'url': row[1], 'title': row[2], 'comment': row[4], 'tags': row[3][1:-1]}
marks.append(record)
else:
@ -715,6 +715,7 @@ def formatJson(resultset, single=False):
else:
marks['url'] = row[1]
marks['title'] = row[2]
marks['comment'] = row[4]
marks['tags'] = row[3][1:-1]
return json.dumps(marks, sort_keys=True, indent=4)
@ -1177,7 +1178,7 @@ power_group=argparser.add_argument_group(title="power toys",
-r, --replace oldtag [newtag ...]
replace oldtag with newtag in all bookmarks
delete oldtag, if no newtag
-j, --json Json formatted output, works with -p, -s
-j, --json Json formatted output, for -p, -s, -S, --st
-o, --open N open bookmark at DB index N in web browser
-z, --debug show debug information and additional logs''')
power_group.add_argument('-p', '--print', nargs='?', dest='printindex', type=int, const=0, metavar='N', help=argparse.SUPPRESS)

2
buku.1
View File

@ -130,7 +130,7 @@ if
is omitted.
.TP
.BI \-j " " \--json
Output data formatted as json (works with -p and -s)
Output data formatted as json, works with -p, -s, -S, --st.
.TP
.BI \-o " " \--open " N"
Open URL at DB index