the_earnest/dotfiles

added verbose option (-v) to function f

Commit 894f880a2299 · The Earnest · 2026-11-23 14:37 +0000

Changeset
894f880a2299ec3a2eb53b129254322e82126a99

View source at this commit

Comments

No comments yet.

Log in to comment

Diff

diff --git a/godir/godir.bash b/godir/godir.bash
--- a/godir/godir.bash
+++ b/godir/godir.bash
@@ -1,4 +1,10 @@
 function f {
+
+	if [[ "$1" == "-v" ]]; then
+		local VERBOSE=verbose
+		shift
+	fi
+
 	FINDCMD="find "
 
 	# exclusions
@@ -16,7 +22,8 @@
 		FINDCMD+=" -iname '*$i*'"
 	done
 	FINDCMD+=" -print"
-	echo FINDCMD=$FINDCMD
+
+	[[ -n $VERBOSE ]] && echo FINDCMD=$FINDCMD
 	eval "$FINDCMD"
 }