From d4be7df074571f41c9c94cec113c132572305317 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pierre-Alb=C3=A9ric=20Trouplin?= Date: Wed, 6 Nov 2019 15:48:04 +0100 Subject: [PATCH 1/3] fix: database flag not working --- bm.py | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/bm.py b/bm.py index 151aa16..6d2cb54 100755 --- a/bm.py +++ b/bm.py @@ -3,12 +3,12 @@ """ Simple command line browser independant bookmark utility -Usage: bm add URL TAG... - bm list [-f FMT] [-w] [-v] [TAG]... - bm tags [-f FMT] [-w] [URL]... - bm remove URL TAG... - bm delete URL... - bm import [-f FMT] FILE... +Usage: bm [-d DB] add URL TAG... + bm [-d DB] list [-f FMT] [-w] [-v] [TAG]... + bm [-d DB] tags [-f FMT] [-w] [URL]... + bm [-d DB] remove URL TAG... + bm [-d DB] delete URL... + bm [-d DB] import [-f FMT] FILE... Commands: add Tag a URL @@ -25,6 +25,7 @@ TAG A tag FILE Path to a file for import GROUP A set of tags; Using a group sets all the tags within that group + DB File database Options: -h, --help Print this help and exit From 7783db98c3739e62006378b03870fcf7485097a9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pierre-Alb=C3=A9ric=20Trouplin?= Date: Wed, 6 Nov 2019 15:51:40 +0100 Subject: [PATCH 2/3] feat: xdg compliant (~/.local/share) --- bm.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/bm.py b/bm.py index 6d2cb54..e76abd1 100755 --- a/bm.py +++ b/bm.py @@ -526,8 +526,10 @@ def main(): global debug debug = lambda *x,**kx: print("[debug]", *x, file=sys.stderr, **kx) - db = Database(args.get("--database", - os.path.expanduser("~/.config/bm/bookmarks.sqlite"))) + db = Database(os.path.expanduser(args["--database"] or + os.getenv('XDG_DATA_HOME', + default='~/.local/share') + + "/bm/bookmarks.sqlite")) if args["add"]: db.add(args["URL"][0], args["TAG"]) From bc92c90e556eb24dae4771166a4038ea0231bb2b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pierre-Alb=C3=A9ric=20Trouplin?= Date: Thu, 7 Nov 2019 21:51:02 +0100 Subject: [PATCH 3/3] fix: database flag not working --- bm.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/bm.py b/bm.py index e76abd1..6d2cb54 100755 --- a/bm.py +++ b/bm.py @@ -526,10 +526,8 @@ def main(): global debug debug = lambda *x,**kx: print("[debug]", *x, file=sys.stderr, **kx) - db = Database(os.path.expanduser(args["--database"] or - os.getenv('XDG_DATA_HOME', - default='~/.local/share') - + "/bm/bookmarks.sqlite")) + db = Database(args.get("--database", + os.path.expanduser("~/.config/bm/bookmarks.sqlite"))) if args["add"]: db.add(args["URL"][0], args["TAG"])