Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 4 Jan 2015 04:10:04 +0100
From:      Stephen Riehm <>
To:        =?windows-1252?Q?Michael_Gr=FCnewald?= <>
Cc:, Polytropon <>
Subject:   Re: TCSH completion patterns and the pkg command
Message-ID:  <>
In-Reply-To: <>
References:  <> <> <>

Next in thread | Previous in thread | Raw E-Mail | Index | Archive | Help
Hi guys,

>> 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.

Wise words :-)

> 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 =97 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 =97 but frankly, I did not try very hard.

You're right that the "<utility> [options] <command> [options] <args>"
style which has emerged in recent years is not what most completion
systems were designed to cope with, and to be honest, you'd need a =
to handle all of the *valid* combinations in many cases... also, the =
the shell tries to complete, the more easily it can be confused.
(e.g. git push 'v' git pull, "git p<tab>" is no longer enough, and
even "git pu<tab>" needs extra correction - and once you've typed "pus"
or "pul" completion doesn't help you any more either - it's still one
more key-stroke)

As is so often the case, you can try for perfect, or you can be happy
with 'good enough' or even 'works for me' :-)

In this case, grep through your history and see which commands and =
options you
use a lot and focus on them.

I've been using some custom tcsh completions and scripts to help
improve my git command line experience for a few years now,=20
(but not pkg etc.). Rather than just waving my hands in the air, I've =
them together and put them up on github for your perusal.
If you're interested, you can find them at =

Perhaps there's some ideas in there to help you put together something =
for pkg.



Want to link to this message? Use this URL: <>