summaryrefslogtreecommitdiff
path: root/pkglocate
diff options
context:
space:
mode:
authoragc <agc>2010-11-11 19:56:34 +0000
committeragc <agc>2010-11-11 19:56:34 +0000
commit6fc7d0efc21fb45c328fe8f5ba0455d8e080775b (patch)
treec55c3c948699cbccc4778c29799b0589335ac9ab /pkglocate
parentf69c341921ce02b8f5cc0eddd4a981da746cb8bd (diff)
downloadpkgsrc-6fc7d0efc21fb45c328fe8f5ba0455d8e080775b.tar.gz
Fix PR 39648:
pkglocate --help enters a loop of `grep --help` by checking the argument before passing it to grep. Please note that "grep -e" can't be used because of Solaris options, although I hope to address that in the next commit.
Diffstat (limited to 'pkglocate')
-rwxr-xr-xpkglocate13
1 files changed, 12 insertions, 1 deletions
diff --git a/pkglocate b/pkglocate
index 474b2fae1d3..dc992607441 100755
--- a/pkglocate
+++ b/pkglocate
@@ -1,6 +1,6 @@
#! /bin/sh
#
-# $NetBSD: pkglocate,v 1.9 2004/07/04 16:12:10 jschauma Exp $
+# $NetBSD: pkglocate,v 1.10 2010/11/11 19:56:34 agc Exp $
#
#-
# Copyright (c) 2000 The NetBSD Foundation, Inc.
@@ -74,7 +74,18 @@ if [ "$verbose" = "yes" ]; then
echo "===> Using $grepname to find matches"
fi
+# do we need to show the help message?
+showhelp=false
+case "$1" in
+--help)
+ showhelp=true
+ ;;
+esac
if [ $# -lt 1 ]; then
+ showhelp=true
+fi
+
+if $showhelp; then
echo "Usage: pkglocate [-i] [-f] [-p] [-v] word"
echo " [-i] ignore case when searching"
echo " [-f] look for a file, rather than a word or phrase"