Better error messages for command not found (was Re: Pull in
upstream before 9.1 code freeze?)
Mike Meyer
mwm at mired.org
Thu Jul 5 01:42:23 UTC 2012
On Wed, 4 Jul 2012 18:03:05 -0700
Tim Kientzle <tim at kientzle.com> wrote:
> I'm curious whether the earlier objections were due to
> misunderstandings about auto-install. Auto-install would
> be problematic, but the feature being discussed here does not
> require installation. Just better error messages.
My objection was not due to misunderstanding about auto-install. I
find the feature annoying - spewing a bunch of crap at me because of a
typo. It annoys me far more often than it actually helps me, because
more often than not the "missing command" is a typo, *not* an attempt
to run a command I don't have. I.e., if I type mmap instead of nmap, I
get:
mwm at IPGhosterCrawlerI:~$ mmap
No command 'mmap' found, did you mean:
Command 'jmap' from package 'openjdk-6-jdk' (main)
Command 'jmap' from package 'openjdk-7-jdk' (universe)
Command 'gmap' from package 'gmap' (multiverse)
Command 'gmap' from package 'scotch' (universe)
Command 'tmap' from package 'emboss' (universe)
Command 'smap' from package 'slurm-llnl' (universe)
Command 'pmap' from package 'procps' (main)
Command 'moap' from package 'moap' (universe)
Command 'umap' from package 'libunicode-map8-perl' (main)
Command 'map' from package 'sgt-puzzles' (universe)
Command 'amap' from package 'amap-align' (universe)
mmap: command not found
That said, this seems to require modification to the ports system to
generate a database for it. And having a command in the base system
that I can feed a command (or better yet, file - I need libraries
almost as often as I need commands) name to and it tells me what
package/port to install would be useful.
Again, I hope a FreeBSD implementation would be a bit more
constrained, and *not* list "similar" commands.
bash and zsh already have command_not_found handlers. I don't really
object to that functionality to sh and tcsh. Just *don't turn it on by
default*. I don't think I'd even object to setting those handlers in
/usr/share/skel.
Of course, I might turn around and ask that we add support for command
correction ala zsh to sh & tcsh via those hooks if they get added.
<mike
--
Mike Meyer <mwm at mired.org> http://www.mired.org/
Independent Software developer/SCM consultant, email for more information.
O< ascii ribbon campaign - stop html mail - www.asciiribbon.org
More information about the freebsd-hackers
mailing list