TCSH completion patterns and the pkg command

Warren Block wblock at wonkity.com
Sun Jan 4 15:18:35 UTC 2015


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.


More information about the freebsd-questions mailing list