Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 7 Jul 2014 22:26:16 -0600 (MDT)
From:      Warren Block <wblock@wonkity.com>
To:        Polytropon <freebsd@edvax.de>
Cc:        freebsd-questions@freebsd.org
Subject:   Re: [Bulk] Re: The name "grep"
Message-ID:  <alpine.BSF.2.11.1407072213050.70461@wonkity.com>
In-Reply-To: <20140708024436.a761d669.freebsd@edvax.de>
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> <alpine.BSF.2.11.1407071352370.87353@wonkity.com> <20140708024436.a761d669.freebsd@edvax.de>

next in thread | previous in thread | raw e-mail | index | archive | help
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.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?alpine.BSF.2.11.1407072213050.70461>