whereis: lookup also info docs

Signed-off-by: Karel Zak <kzak@redhat.com>
This commit is contained in:
Karel Zak 2015-02-02 11:15:47 +01:00
parent 9ac1fcf6c5
commit db0ccb761d
2 changed files with 6 additions and 4 deletions

View File

@ -100,7 +100,8 @@ searches for binaries, by a whitespace-separated list of directories.
.IP "\fB\-M \fIlist\fP"
Limit the places where
.B whereis
searches for manuals, by a whitespace-separated list of directories.
searches for manuals and documentation in Info format, by a
whitespace-separated list of directories.
.IP "\fB\-S \fIlist\fP"
Limit the places where
.B whereis

View File

@ -154,6 +154,7 @@ static const char *mandirs[] = {
"/usr/X11/man/*",
"/usr/TeX/man/*",
"/usr/interviews/man/mann",
"/usr/share/info",
NULL
};
@ -193,8 +194,8 @@ static void __attribute__((__noreturn__)) usage(FILE *out)
fputs(USAGE_OPTIONS, out);
fputs(_(" -b search only for binaries\n"), out);
fputs(_(" -B <dirs> define binaries lookup path\n"), out);
fputs(_(" -m search only for manuals\n"), out);
fputs(_(" -M <dirs> define man lookup path\n"), out);
fputs(_(" -m search only for manuals and infos\n"), out);
fputs(_(" -M <dirs> define man and info lookup path\n"), out);
fputs(_(" -s search only for sources\n"), out);
fputs(_(" -S <dirs> define sources lookup path\n"), out);
fputs(_(" -f terminate <dirs> argument list\n"), out);
@ -372,7 +373,7 @@ static int filename_equal(const char *cp, const char *dp)
{
int i = strlen(dp);
/*DBG(printf("compare '%s' and '%s'", cp, dp));*/
DBG(SEARCH, ul_debug("compare '%s' and '%s'", cp, dp));
if (dp[0] == 's' && dp[1] == '.' && filename_equal(cp, dp + 2))
return 1;