From 8c7ef3ec3437f68bf45cf0e20cda35eb28724010 Mon Sep 17 00:00:00 2001 From: Arun Prakash Jana Date: Thu, 19 May 2016 00:45:57 +0530 Subject: [PATCH] Add comment in Json output. --- README.md | 2 +- buku | 5 +++-- buku.1 | 2 +- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index cb379a4..815be14 100644 --- a/README.md +++ b/README.md @@ -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 diff --git a/buku b/buku index c9e7989..0c923a8 100755 --- a/buku +++ b/buku @@ -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) diff --git a/buku.1 b/buku.1 index f50e6f2..eca1b24 100644 --- a/buku.1 +++ b/buku.1 @@ -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