summaryrefslogtreecommitdiff
path: root/scripts/Scripts/goto
diff options
context:
space:
mode:
authorJulian T <julian@jtle.dk>2021-01-28 23:57:44 +0100
committerJulian T <julian@jtle.dk>2021-01-28 23:57:44 +0100
commitf38b8e6b39d8fce125d3994764cb28153ec477f7 (patch)
tree8659fdff71fd6ae69f0d7a3c83a0b5fa8c3a74b9 /scripts/Scripts/goto
parent78d50457a6497bf75ec5600edb60d4835e7d770e (diff)
Goto changes
Diffstat (limited to 'scripts/Scripts/goto')
-rwxr-xr-xscripts/Scripts/goto12
1 files changed, 8 insertions, 4 deletions
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)