Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 4 Jan 2015 08:18:28 -0700 (MST)
From:      Warren Block <wblock@wonkity.com>
To:        Polytropon <freebsd@edvax.de>
Cc:        =?ISO-8859-15?Q?Michael_Gr=FCnewald?= <michipili@gmail.com>, questions@freebsd.org
Subject:   Re: TCSH completion patterns and the pkg command
Message-ID:  <alpine.BSF.2.11.1501040808040.85764@wonkity.com>
In-Reply-To: <20150104065419.964edb45.freebsd@edvax.de>
References:  <54A85003.3000301@gmail.com> <20150103203734.5086dfd6.freebsd@edvax.de> <54A8836D.1010805@gmail.com> <alpine.BSF.2.11.1501032207090.37904@wonkity.com> <20150104065419.964edb45.freebsd@edvax.de>

next in thread | previous in thread | raw e-mail | index | archive | help
On Sun, 4 Jan 2015, Polytropon wrote:
> On Sat, 3 Jan 2015 22:09:32 -0700 (MST), Warren Block wrote:
>> On Sun, 4 Jan 2015, Michael Grünewald wrote:
>>>
>>> It seems to me that it is very hard to propose pertinent
>>> completions for git if we do not take the current subcommand
>>> into account ? but frankly, I did not try very hard.
>>
>> Some completions here, including some moderate ones for pkg:
>> http://www.wonkity.com/~wblock/csh/completions
>
> Your completition suggestion was the one I've been
> refering to. It's very nicely done, but of course
> it won't be possible to cope with all imaginable
> combinations of commands and subcommands and their
> specific options. Trying to have all all of them
> autocompleted, plus the many GNU long style options,
> would probably too much for a shell - and the main-
> tainer of the completition list to always keep it
> current and valid. :-)

Yes, and the csh completion syntax is challenging for complex commands. 
An external program can be run to provide completions, and that's 
probably the way to go for the really complex ones.  I've avoided that 
so far, but complex commands with subcommands like git, pkg, zfs, and 
svn might be easier, clearer, or more maintainable to do that way.

> It is, however, debatable in how far this should be
> part of the OS preconfiguration. I'm happy about the
> C shell now having adopted a normal UNIX prompt, but
> I wouldn't assume that everyone on earth would be
> happy with my ls defaults as _his_ defaults:
>
> 	% grep -i ls /etc/csh.cshrc | less
> 	alias   ls              'ls -FG -D "%Y-%m-%d %H:%M:%S"'
> 	alias   ll              'ls -laFG -D "%Y-%m-%d %H:%M:%S"'
> 	setenv  LSCOLORS        ExGxdxdxCxDxDxBxBxege

Completions are not really the same kind of problem, or at least they 
don't differ because people use the same programs.  I think of them as a 
sort of built-in help for input, helping to make legitimate choices 
rather than what I might remember.  And I would like to see a much 
larger default set of autocompletions.  They make so many commands 
easier to use.
From owner-freebsd-questions@FreeBSD.ORG  Sun Jan  4 15:40:41 2015
Return-Path: <owner-freebsd-questions@FreeBSD.ORG>
Delivered-To: questions@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id 53F3262E
 for <questions@freebsd.org>; Sun,  4 Jan 2015 15:40:41 +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 0824764C30
 for <questions@freebsd.org>; Sun,  4 Jan 2015 15:40:40 +0000 (UTC)
Received: from wonkity.com (localhost [127.0.0.1])
 by wonkity.com (8.14.9/8.14.9) with ESMTP id t04FeZMF094401
 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO);
 Sun, 4 Jan 2015 08:40:36 -0700 (MST)
 (envelope-from wblock@wonkity.com)
Received: from localhost (wblock@localhost)
 by wonkity.com (8.14.9/8.14.9/Submit) with ESMTP id t04FeZ8K094398;
 Sun, 4 Jan 2015 08:40:35 -0700 (MST)
 (envelope-from wblock@wonkity.com)
Date: Sun, 4 Jan 2015 08:40:35 -0700 (MST)
From: Warren Block <wblock@wonkity.com>
To: Michael <michipili@gmail.com>
Subject: Re: TCSH completion patterns and the pkg command
In-Reply-To: <54A942DE.9060203@gmail.com>
Message-ID: <alpine.BSF.2.11.1501040818330.85764@wonkity.com>
References: <54A85003.3000301@gmail.com>
 <20150103203734.5086dfd6.freebsd@edvax.de> <54A8836D.1010805@gmail.com>
 <alpine.BSF.2.11.1501032207090.37904@wonkity.com>
 <54A942DE.9060203@gmail.com>
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]); Sun, 04 Jan 2015 08:40:36 -0700 (MST)
Cc: questions@freebsd.org, Polytropon <freebsd@edvax.de>
X-BeenThere: freebsd-questions@freebsd.org
X-Mailman-Version: 2.1.18-1
Precedence: list
List-Id: User questions <freebsd-questions.freebsd.org>
List-Unsubscribe: <http://lists.freebsd.org/mailman/options/freebsd-questions>, 
 <mailto:freebsd-questions-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/freebsd-questions/>;
List-Post: <mailto:freebsd-questions@freebsd.org>
List-Help: <mailto:freebsd-questions-request@freebsd.org?subject=help>
List-Subscribe: <http://lists.freebsd.org/mailman/listinfo/freebsd-questions>, 
 <mailto:freebsd-questions-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Sun, 04 Jan 2015 15:40:41 -0000

On Sun, 4 Jan 2015, Michael wrote:

> Warren Block wrote:
>> Some completions here, including some moderate ones for pkg:
>> http://www.wonkity.com/~wblock/csh/completions
>
> Hi Warren, your completions look very interesting! Do you mind if I
> include and rework them with due credit in
>
>  https://github.com/michipili/tcshfiles
>
> It is distributed under CECILL-B, a BSD-style license.

Sure, my list is a collection anyway.  Many were collected from csh/tcsh 
examples and online sources, some I wrote by myself, and some were 
collaborations.  The original "make" completion that showed all 
available targets was created with help from forum members.  Then 
make(1) changed, and the new one made it much simpler.  Incidentally, 
the completion for "make -V ", which should complete with all available 
make variables, does not yet work.

The sharp-eyed will see a completion for kldreload, which does not 
exist in the wild but is an alias:

   alias kldreload 'kldunload \!* && sleep 0.1 && kldload \!*'

(Used mostly for reloading the VirtualBox kernel module after a 
rebuild.)

Some of these are integrated into /usr/share/examples/csh/dot.cshrc. 
There are more completions in /usr/share/examples/tcsh/complete.tcsh, 
too.



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