]> git.ipfire.org Git - thirdparty/util-linux.git/blobdiff - misc-utils/whereis.c
lsblk: keep functions names consistent
[thirdparty/util-linux.git] / misc-utils / whereis.c
index 897a7a2135b7775ebcef828bcca4b32f093adf91..828106ffe79ed9b8f9a42d9a221084ce002d1d7f 100644 (file)
@@ -72,6 +72,9 @@ UL_DEBUG_DEFINE_MASKNAMES(whereis) = UL_DEBUG_EMPTY_MASKNAMES;
 #define DBG(m, x)       __UL_DBG(whereis, WHEREIS_DEBUG_, m, x)
 #define ON_DBG(m, x)    __UL_DBG_CALL(whereis, WHEREIS_DEBUG_, m, x)
 
+#define UL_DEBUG_CURRENT_MASK  UL_DEBUG_MASK(whereis)
+#include "debugobj.h"
+
 static char uflag = 0;
 
 /* supported types */
@@ -96,6 +99,11 @@ struct wh_dirlist {
 static const char *bindirs[] = {
        "/usr/bin",
        "/usr/sbin",
+#if defined(MULTIARCHTRIPLET)
+       "/lib/" MULTIARCHTRIPLET,
+       "/usr/lib/" MULTIARCHTRIPLET,
+       "/usr/local/lib/" MULTIARCHTRIPLET,
+#endif
        "/usr/lib",
        "/usr/lib64",
        "/bin",
@@ -170,7 +178,7 @@ static const char *srcdirs[] = {
 
 static void whereis_init_debug(void)
 {
-       __UL_INIT_DEBUG(whereis, WHEREIS_DEBUG_, 0, WHEREIS_DEBUG);
+       __UL_INIT_DEBUG_FROM_ENV(whereis, WHEREIS_DEBUG_, 0, WHEREIS_DEBUG);
 }
 
 static const char *whereis_type_to_name(int type)
@@ -205,9 +213,8 @@ static void __attribute__((__noreturn__)) usage(void)
        fputs(_(" -l         output effective lookup paths\n"), out);
 
        fputs(USAGE_SEPARATOR, out);
-       fputs(USAGE_HELP, out);
-       fputs(USAGE_VERSION, out);
-       fprintf(out, USAGE_MAN_TAIL("whereis(1)"));
+       printf(USAGE_HELP_OPTIONS(16));
+       printf(USAGE_MAN_TAIL("whereis(1)"));
        exit(EXIT_SUCCESS);
 }
 
@@ -451,7 +458,7 @@ static void lookup(const char *pattern, struct wh_dirlist *ls, int want)
        DBG(SEARCH, ul_debug("lookup dirs for '%s' (%s), want: %s %s %s",
                                patbuf, pattern,
                                want & BIN_DIR ? "bin" : "",
-                               want & MAN_DIR ? "min" : "",
+                               want & MAN_DIR ? "man" : "",
                                want & SRC_DIR ? "src" : ""));
        p = strrchr(patbuf, '.');
        if (p)