From f38b8e6b39d8fce125d3994764cb28153ec477f7 Mon Sep 17 00:00:00 2001 From: Julian T Date: Thu, 28 Jan 2021 23:57:44 +0100 Subject: Goto changes --- scripts/Scripts/goto | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'scripts/Scripts') diff --git a/scripts/Scripts/goto b/scripts/Scripts/goto index b0c34fb..dda8fa6 100755 --- a/scripts/Scripts/goto +++ b/scripts/Scripts/goto @@ -56,6 +56,7 @@ parser.add_argument("--save", "-s", help="Save current location with name, if '. parser.add_argument("--path", "-p", help="Specifies if `dest` is a real path and not a bookmark", action="store_true") parser.add_argument("--list", "-l", help="List bookmarks", action="store_true") parser.add_argument("--edit", "-e", help="Edit bookmark file with $EDITRO", action="store_true") +parser.add_argument("--print", "-d", help="Just print the resulting path", action="store_true") parser.add_argument("dest", nargs="?", help="Where to go") args = parser.parse_args() @@ -77,8 +78,11 @@ if args.save: if args.dest: where = bm.load(args.dest) if not args.path else args.dest - with open("/tmp/where", "w") as f: - f.write(where) - # This means zsh should go here - sys.exit(3) + if args.print: + print(where) + else: + with open("/tmp/where", "w") as f: + f.write(where) + # This means zsh should go here + sys.exit(3) -- cgit v1.2.3