about summary refs log tree commit diff
path: root/xlocate
diff options
context:
space:
mode:
authormaxice8 <thinkabit.ukim@gmail.com>2018-11-19 00:31:32 -0200
committerLeah Neukirchen <leah@vuxu.org>2018-11-19 13:46:05 +0100
commit5edebea0a738117dde41077cd23756e79f4417e7 (patch)
tree9e8a8f95ff080f197be3048958b08ca6a1870800 /xlocate
parent39f835989f79e4c042ee954f803142d0c8ba3bf0 (diff)
downloadxtools-5edebea0a738117dde41077cd23756e79f4417e7.tar.gz
xtools-5edebea0a738117dde41077cd23756e79f4417e7.tar.xz
xtools-5edebea0a738117dde41077cd23756e79f4417e7.zip
xlocate: don't mark anything starting with a hyphen as an invalid option v0.53
Unbreaks usecases where you want to start searching all files that end
with -<word> like -config or -x11

Closes: #105 [via git-merge-pr]
Diffstat (limited to 'xlocate')
-rwxr-xr-xxlocate7
1 files changed, 2 insertions, 5 deletions
diff --git a/xlocate b/xlocate
index 1d2d41b..a4f013f 100755
--- a/xlocate
+++ b/xlocate
@@ -52,9 +52,6 @@ case "$1" in
 -S)
 	xsyncgit
 	exit $?;;
--*)
-	echo "xlocate: invalid option '$1'" 1>&2
-	exit 1;;
 '')
 	echo "Usage: xlocate [-g | -S | PATTERN]" 1>&2
 	exit 1;;
@@ -73,9 +70,9 @@ if [ -d "$XLOCATE_GIT" ]; then
 			echo "xlocate: database outdated, please run xlocate -g." 1>&2
 		fi
 	fi
-	git -c grep.lineNumber=false --git-dir="$XLOCATE_GIT" grep "$@" @ |
+	git -c grep.lineNumber=false --git-dir="$XLOCATE_GIT" grep -- "$@" @ |
 		sed 's/^@://; s/:/\t/' | grep .
 else
-	xbps-query --regex -Ro "$@" |
+	xbps-query --regex -Ro -- "$@" |
 		sed 's/ *([^)]*)$//; s/^\([^ ]*\)-[^-]*: /\1\t/'
 fi