From owner-freebsd-questions@FreeBSD.ORG Tue Jul 8 04:26:29 2014 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B8C9A1A9 for ; Tue, 8 Jul 2014 04:26:29 +0000 (UTC) Received: from wonkity.com (wonkity.com [67.158.26.137]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "wonkity.com", Issuer "wonkity.com" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4783027B7 for ; Tue, 8 Jul 2014 04:26:28 +0000 (UTC) Received: from wonkity.com (localhost [127.0.0.1]) by wonkity.com (8.14.9/8.14.9) with ESMTP id s684QGMZ074167 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Mon, 7 Jul 2014 22:26:16 -0600 (MDT) (envelope-from wblock@wonkity.com) Received: from localhost (wblock@localhost) by wonkity.com (8.14.9/8.14.9/Submit) with ESMTP id s684QGoS074164; Mon, 7 Jul 2014 22:26:16 -0600 (MDT) (envelope-from wblock@wonkity.com) Date: Mon, 7 Jul 2014 22:26:16 -0600 (MDT) From: Warren Block To: Polytropon Subject: Re: [Bulk] Re: The name "grep" In-Reply-To: <20140708024436.a761d669.freebsd@edvax.de> Message-ID: References: <20140707075443.d47ca06a.freebsd@edvax.de> <53BA4F77.60907@qeng-ho.org> <20140707104403.5a0694ff.freebsd@edvax.de> <53BA71A7.9040208@qeng-ho.org> <1404728392.19389.1.camel@archlinux> <53BA9EC0.9000201@qeng-ho.org> <20140707160528.7ecf9855.freebsd@edvax.de> <1404750481.19389.12.camel@archlinux> <53BAD236.3060501@qeng-ho.org> <20140708024436.a761d669.freebsd@edvax.de> User-Agent: Alpine 2.11 (BSF 23 2013-08-11) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.4.3 (wonkity.com [127.0.0.1]); Mon, 07 Jul 2014 22:26:16 -0600 (MDT) Cc: freebsd-questions@freebsd.org X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 08 Jul 2014 04:26:29 -0000 On Tue, 8 Jul 2014, Polytropon wrote: > On Mon, 7 Jul 2014 13:56:32 -0600 (MDT), Warren Block wrote: >> There's an ongoing thread in the forums about csh completions. dd is >> one of them: >> >> complete dd 'c/if=/f/' 'c/of=/f/' \ >> 'c/conv=*,/(ascii block ebcdic lcase pareven noerror notrunc osync sparse swab sync unblock)/,' \ >> 'c/conv=/(ascii block ebcdic lcase pareven noerror notrunc osync sparse swab sync unblock)/,' \ >> 'p/*/(bs cbs count files fillcahr ibs if iseek obs of oseek seek skip conv)/=' > > Thanks, this is really helpful - I made it available system-wide > in /etc/csh.cshrc's "if ($?prompt) then ... endif" block. It makes > using the C shell (as a dialog shell) a better experience and still > surprises me that csh is "that powerful". The full file is here: http://www.wonkity.com/~wblock/csh/completions Some of those are surprisingly helpful, like having make(1) complete maketargets (is it fetchurl-all or fetch-urlall?). It would be nice to have 'make -V' complete with make variables, but it takes a fair amount of processing to pull them out of make output, and I've been trying to avoid Perl and stick with things that are only available in base. However, the man page completion one is where the weakness of shell tools like sed and awk finally got to me and I just used Perl. If anyone wants to come up with a sh version of that, please share. This one is very recent. There are lots more of these that could be useful. Good implementations for zfs and zpool would be useful. The gpart one just shows help rather than actually completing, but it's a good reminder. The ezjail-admin one is another new one I did recently, and has not been really filled out yet. These completions make input a lot easier and reduce errors because they only complete with valid choices. Well, the better-quality ones. We should encourage people to use completions and add more.