TCSH completion patterns and the pkg command

Michael Grünewald michipili at gmail.com
Sat Jan 3 19:24:39 UTC 2015


The C-shell included in the base system is a popular(?) interactive
shell among FreeBSD users.  It features a useful completion mechanism
which works very well for commands using a classical(?) UNIX syntax:

    command -a argA -b argB --longopt longarg item1 item2 …

Some popular software package such as git or subversion use a small
variation of this UNIX syntax which, to the best of my knowledge,
defeats the C-shell:

    command subcommand -a argA -b argB --longopt longarg item1 item2 …

Today, there is several important commands in FreeBSD using such
a scheme, such as pkg, pw or gpart.

Do we have any plans to enhance the C-shell completion features to
deal nicely with this scheme?

An easy workaround is to define an alias for each subcommand, I use
this strategy in my tcshfiles:

   https://github.com/michipili/tcshfiles/commit/9caf67c

It would however be nicer to have a more capable completion system
in the C-shell.
-- 
Michael


More information about the freebsd-questions mailing list