From owner-freebsd-hackers@FreeBSD.ORG Thu Jul 5 02:02:17 2012 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E191D106564A for ; Thu, 5 Jul 2012 02:02:16 +0000 (UTC) (envelope-from tim@kientzle.com) Received: from monday.kientzle.com (99-115-135-74.uvs.sntcca.sbcglobal.net [99.115.135.74]) by mx1.freebsd.org (Postfix) with ESMTP id B79A58FC14 for ; Thu, 5 Jul 2012 02:02:16 +0000 (UTC) Received: (from root@localhost) by monday.kientzle.com (8.14.4/8.14.4) id q6522CRJ095646; Thu, 5 Jul 2012 02:02:12 GMT (envelope-from tim@kientzle.com) Received: from [192.168.2.143] (CiscoE3000 [192.168.1.65]) by kientzle.com with SMTP id kyb2py8nw4pnuybus8dpsss7qs; Thu, 05 Jul 2012 02:02:12 +0000 (UTC) (envelope-from tim@kientzle.com) Mime-Version: 1.0 (Apple Message framework v1278) Content-Type: text/plain; charset=us-ascii From: Tim Kientzle In-Reply-To: <20120704214216.29085927@bhuda.mired.org> Date: Wed, 4 Jul 2012 19:02:11 -0700 Content-Transfer-Encoding: 7bit Message-Id: <8BD384B7-BAE3-46ED-9AFD-50319130767E@kientzle.com> References: <86bojxow6x.fsf@ds4.des.no> <4FF35864.5030109@FreeBSD.org> <20120704185104.GA42355@DataIX.net> <4FF4B36A.2040608@FreeBSD.org> <20120704180134.7c649e1b@bhuda.mired.org> <4FF4BEED.10103@FreeBSD.org> <20120704225519.GB19945@DataIX.net> <4FF4CAD1.8080804@FreeBSD.org> <20120704234104.GA392@DataIX.net> <8E9DECBB-3D1E-4129-A958-9DB0DF69ECC3@kientzle.com> <4FF4E105.50502@FreeBSD.org> <20120704203711.2732b645@bhuda.mired.org> <2EA305F0-87D9-47BE-B3E6-366659BF77AF@kientzle.com> <20120704214216.29085927@bhuda.mired.org> To: Mike Meyer X-Mailer: Apple Mail (2.1278) Cc: freebsd-hackers@freebsd.org Subject: Re: Better error messages for command not found (was Re: Pull in upstream before 9.1 code freeze?) X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 05 Jul 2012 02:02:17 -0000 On Jul 4, 2012, at 6:42 PM, Mike Meyer wrote: > On Wed, 4 Jul 2012 18:03:05 -0700 > Tim Kientzle 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@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 I agree this is excessive. In this case, a better UI might be to separate the typo handling from the package reference, so that you would see something like this: $ mmap mmap: command not found Perhaps you meant one of: jmap, gmap, tmap, smap, (8 others) That way, if you did really mean jmap, you could try again and see $ jmap jmap: command not found Try installing one of the following packages: java/openjdk-6-jdk java/openjdk-7-jdk I agree also about the convenience of having a tool that can identify the port/package that would install a particular library (or other file). I too have run into the situation where I need a particular library and can't figure out what the package is called. > 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. How about if it's on by default (in the default /etc/cshrc) but very easy to turn off? The primary point of such a feature is to help people new to FreeBSD. Someone who sits down at a new FreeBSD installation and wants to run 'nmap' can then get up to speed a lot more quickly, since they'll be pointed at the right package right away. > 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. > Tim