The conclusion of a command whereis is not pleasant to me. Here an example: %whereis vim vim:/usr/local/bin/vim/usr/local/man/man1/vim.1.gz/usr/ports/editors/vim Well it is not readable! And if the file does not exist, in general messages on a mistake is not printed: %whereis vim_ Has decided to modify a part of a source code (/usr/src/usr.bin/whereis/whereis.c): /*begin*/ if (!opt_q) { /* printf("%s:", name); */ printed++; printf ("%s:", name); } if (bin) { /* if (printed++) putchar(' '); fputs(bin, stdout); */ printf ("\n %s", bin); } if (man) { /* if (printed++) putchar(' '); fputs(man, stdout); */ printf ("\n %s", man); } if (src) { /* if (printed++) putchar(' '); fputs(src, stdout); */ printf ("\n %s\n", src); } if (!printed) putchar('\n'); /* If files have not been found */ if ((!bin) && (!man) && (!src)) printf (" not found!\n"); /*end*/ Now all is much more pleasant: %whereis vim vim: /usr/local/bin/vim /usr/local/man/man1/vim.1.gz /usr/ports/editors/vim And in case of a mistake: %whereis vim_ vim_: not found! Fix: if (!opt_q) { /* printf("%s:", name); */ printed++; printf ("%s:", name); } if (bin) { /* if (printed++) putchar(' '); fputs(bin, stdout); */ printf ("\n %s", bin); } if (man) { /* if (printed++) putchar(' '); fputs(man, stdout); */ printf ("\n %s", man); } if (src) { /* if (printed++) putchar(' '); fputs(src, stdout); */ printf ("\n %s\n", src); } if (!printed) putchar('\n'); /* If files have not been found */ if ((!bin) && (!man) && (!src)) printf (" not found!\n");
Responsible Changed From-To: freebsd-bugs->edwin I'll see if I can do something with it. It most likely will be, to not break current implementations, an option called -h (human readable) which will use the output you proposed.
State Changed From-To: open->feedback Can this PR be closed? 'whereis vim' reports: 'vim: /usr/local/bin/vim /usr/local/man/man1/vim.1.gz /usr/ports/editors/vim', which imo is very well readable. Also whereis is a re-implementation of the historic whereis utility (see whereis(1) man page) and thus the output, when no matches are found, cannot be changed. the suggested '%s: not found!' would therefor break historic behaviour and thus scripts which rely on this behavior. Alex
For bugs matching the following criteria: Status: In Progress Changed: (is less than) 2014-06-01 Reset to default assignee and clear in-progress tags. Mail being skipped