From ee16a4cbc36f61fc62f240f99594bcafefb9f5c3 Mon Sep 17 00:00:00 2001 From: lmessier Date: Mon, 21 Mar 2016 13:37:52 +0100 Subject: [PATCH] Handle a new -j command line flag --- buku | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/buku b/buku index 4285fa3..46b35f5 100755 --- a/buku +++ b/buku @@ -67,6 +67,7 @@ titleManual = None refresh = False encrypt = False decrypt = False +jsonOutput = False iterations = int(8) @@ -81,6 +82,7 @@ def usage(): print(" -D delete ALL bookmarks") print(" -g show all tags (sorted alphabetically)") print(" -i N insert entry at DB index N, useful to fill deleted index") + print(" -j Output data formatted as json") print(" -k decrypt (unlock) database file") print(" -l encrypt (lock) database file") print(" -m manually add or update the title offline") @@ -641,7 +643,7 @@ if len(sys.argv) < 2: # Check cmdline options try: - optlist, keywords = getopt(sys.argv[1:], "d:i:m:o:p:t:u:x:aDgklPRsSwz") + optlist, keywords = getopt(sys.argv[1:], "d:i:m:o:p:t:u:x:aDgjklPRsSwz") if len(optlist) < 1: usage() @@ -686,6 +688,8 @@ try: usage() addurl = True + elif opt[0] == "-j": + jsonOutput = True elif opt[0] == "-k": if no_crypto == True: print("Error: PyCrypto missing")