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

Next in thread | Previous in thread | Raw E-Mail | Index | Archive | Help
On Sun, 4 Jan 2015, Michael Grünewald wrote:

> Polytropon wrote:
>> The C shell is the system's _default_ interactive shell.
>> This statement does not carry any judgmental statement. :-)
>
> I was not sure any more about this, so I went lazy and blurry. :)
>
>> In my opinion, this is possible, but not easy. I'd say
>> it's easier to teach the C shell the completition rules
>> for the commands you want.
>
> I am not sure it easier to do so.  If we consider the special
> example of git:
>
> * We have several possible sort of completion lists:
>   remotes, branch names, tags, and commit hashs ? the latter
>   are commonly used for git commit --fixup et al.
> * We have a lot of subcommands having many options whose names
>   sometimes collide and do not always use the same arguments
>   (e.g. git diff -b and git checkout -b).
>
> 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
From owner-freebsd-questions@FreeBSD.ORG  Sun Jan  4 05:54:24 2015
Return-Path: <owner-freebsd-questions@FreeBSD.ORG>
Delivered-To: questions@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id A8BD24BF
 for <questions@freebsd.org>; Sun,  4 Jan 2015 05:54:24 +0000 (UTC)
Received: from mx01.qsc.de (mx01.qsc.de [213.148.129.14])
 (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 3CC8F6493E
 for <questions@freebsd.org>; Sun,  4 Jan 2015 05:54:23 +0000 (UTC)
Received: from r56.edvax.de (port-92-195-85-165.dynamic.qsc.de [92.195.85.165])
 (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by mx01.qsc.de (Postfix) with ESMTPS id 3888E3CD85;
 Sun,  4 Jan 2015 06:54:19 +0100 (CET)
Received: from r56.edvax.de (localhost [127.0.0.1])
 by r56.edvax.de (8.14.5/8.14.5) with SMTP id t045sJg7002009;
 Sun, 4 Jan 2015 06:54:19 +0100 (CET) (envelope-from freebsd@edvax.de)
Date: Sun, 4 Jan 2015 06:54:19 +0100
From: Polytropon <freebsd@edvax.de>
To: Warren Block <wblock@wonkity.com>
Subject: Re: TCSH completion patterns and the pkg command
Message-Id: <20150104065419.964edb45.freebsd@edvax.de>
In-Reply-To: <alpine.BSF.2.11.1501032207090.37904@wonkity.com>
References: <54A85003.3000301@gmail.com>
 <20150103203734.5086dfd6.freebsd@edvax.de>
 <54A8836D.1010805@gmail.com>
 <alpine.BSF.2.11.1501032207090.37904@wonkity.com>
Reply-To: Polytropon <freebsd@edvax.de>
Organization: EDVAX
X-Mailer: Sylpheed 3.1.1 (GTK+ 2.24.5; i386-portbld-freebsd8.2)
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
Cc: Michael =?ISO-8859-1?Q?Gr=FCnewald?= <michipili@gmail.com>,
 questions@freebsd.org
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 05:54:24 -0000

On Sat, 3 Jan 2015 22:09:32 -0700 (MST), Warren Block wrote:
> On Sun, 4 Jan 2015, Michael Gr=FCnewald wrote:
>=20
> > Polytropon wrote:
> >> The C shell is the system's _default_ interactive shell.
> >> This statement does not carry any judgmental statement. :-)
> >
> > I was not sure any more about this, so I went lazy and blurry. :)
> >
> >> In my opinion, this is possible, but not easy. I'd say
> >> it's easier to teach the C shell the completition rules
> >> for the commands you want.
> >
> > I am not sure it easier to do so.  If we consider the special
> > example of git:
> >
> > * We have several possible sort of completion lists:
> >   remotes, branch names, tags, and commit hashs ? the latter
> >   are commonly used for git commit --fixup et al.
> > * We have a lot of subcommands having many options whose names
> >   sometimes collide and do not always use the same arguments
> >   (e.g. git diff -b and git checkout -b).
> >
> > 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.
>=20
> 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. :-)

Anyway, your list (and the comment header explaining
the syntax) is a good base to build on.

In the special case of "git push" and "git pull"
which are fully equivalent up to the 's' or 'l',
it could be possible to alias them, where the
alias is "earlier unambiguous", and then have that
alias autocompleted. Here a combination of aliases
and completition patterns could work more reliably
than just completition.

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

:-)


--=20
Polytropon
Magdeburg, Germany
Happy FreeBSD user since 4.0
Andra moi ennepe, Mousa, ...



Want to link to this message? Use this URL: <http://docs.FreeBSD.org/cgi/mid.cgi?alpine.BSF.2.11.1501032207090.37904>