summaryrefslogtreecommitdiffstats
path: root/misc-utils/whereis.1
diff options
context:
space:
mode:
authorKarel Zak2014-10-23 14:29:45 +0200
committerKarel Zak2014-10-23 14:29:45 +0200
commitf4802c901134c56718e0c47308536c7eb2d552ae (patch)
treed0be6912218daf934a2644a24050d9c97c168d0a /misc-utils/whereis.1
parentwhereis: cleanup debug stuff, fix argv[] usage (diff)
downloadkernel-qcow2-util-linux-f4802c901134c56718e0c47308536c7eb2d552ae.tar.gz
kernel-qcow2-util-linux-f4802c901134c56718e0c47308536c7eb2d552ae.tar.xz
kernel-qcow2-util-linux-f4802c901134c56718e0c47308536c7eb2d552ae.zip
whereis: reset search mask more carefully
# whereis -m cal -M /usr/share/man/man1/ -f ls cal: /usr/share/man/man1/cal.1.gz /usr/share/man/man1p/cal.1p.gz ls: /usr/bin/ls /usr/share/man/man1/ls.1.gz the -M also resets the search mask, so for 'ls' it returns also binaries. That's bug. Expected result is: # ./whereis -m cal -M /usr/share/man/man1/ -f ls cal: /usr/share/man/man1/cal.1.gz /usr/share/man/man1p/cal.1p.gz ls: /usr/share/man/man1/ls.1.gz the search mask has to be sensitive only to -b -m -s options, otherwise the semantic is pretty messy. Signed-off-by: Karel Zak <kzak@redhat.com>
Diffstat (limited to 'misc-utils/whereis.1')
-rw-r--r--misc-utils/whereis.127
1 files changed, 24 insertions, 3 deletions
diff --git a/misc-utils/whereis.1 b/misc-utils/whereis.1
index fde0dd779..e8e432722 100644
--- a/misc-utils/whereis.1
+++ b/misc-utils/whereis.1
@@ -56,14 +56,35 @@ in the places specified by
.B $PATH
and
.BR $MANPATH .
+
+The search restrinctions (options \fB\-b\fP, \fB\-m\fP and \fB\-s\fP) are
+cumulative and always applied for the next \fIname\fP patterns specified on
+command line. The first search restrinction resets the search mask. For example
+.RS
+.sp
+.B "whereis -bm ls tr -m gcc"
+.sp
+.RE
+searchs for "ls" and "tr" binaries and man pages, and "gcc" man pages only.
+
+The options \fB\-B\fP, \fB\-M\fP and \fB\-S\fP resets search paths for the next
+\fIname\fP patterns. For example
+.RS
+.sp
+.B "whereis -m ls -M /usr/share/man/man1 -f cal"
+.sp
+.RE
+searchs for "ls" man pages in all default paths, but for "cal" in
+/usr/share/man/man1 directory only.
+
.SH OPTIONS
.TP
.IP \fB\-b\fP
-Search only for binaries.
+Search for binaries.
.IP \fB\-m\fP
-Search only for manuals.
+Search for manuals.
.IP \fB\-s\fP
-Search only for sources.
+Search for sources.
.IP \fB\-u\fP
Only show the command names that have unusual entries. A command is said to be
unusual if it does not have just one entry of each explicitly requested type.