From 8b1fb75881080789c34d8812df20788cb8b5dec0 Mon Sep 17 00:00:00 2001 From: Alex Karle Date: Mon, 21 Feb 2022 21:57:34 -0500 Subject: [PATCH] bin: Modify plumb(1) to only take first field All of the types I plumb shouldn't have spaces in them, so this enables things like plumbing the whole line on git-blame just for the SHA: c5ba384f (Alex Karle 2022-02-21 20:05:22 -0500 31) [1]: no-color.org --- bin/plumb | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/bin/plumb b/bin/plumb index cc5b912..a2d9a8d 100755 --- a/bin/plumb +++ b/bin/plumb @@ -1,16 +1,14 @@ #!/bin/sh # plumb -- plumber for tmux's copy-pipe # reads the item to plumb from stdin, optionally takes a working dir -IFS=' -' read ITEM if [ -n "$1" ]; then cd "$1" fi -# trim whitespace off the ITEM -ITEM=$(echo "$ITEM" | xargs) +# only accept first argument (by whitespace) +ITEM=$(echo "$ITEM" | awk '{ print $1 }') case "$ITEM" in http*) firefox "$ITEM" ;; -- libgit2 1.1.1