M4444 / TMatrix

Terminal based replica of the digital rain from The Matrix.
GNU General Public License v2.0
382 stars 14 forks source link

Added tcsh completion #17

Closed Br1ght0ne closed 5 years ago

Br1ght0ne commented 5 years ago

I'm not well-versed in tcsh, but this should suffice for now. If somebody with an experience in tcsh completions, it can be changed later.

Related to #5.

M4444 commented 5 years ago

Heh, you seem to really like these completion scripts :D Hopefully I can get to review this soon but in the meantime you can add a licence header and tabs.

Br1ght0ne commented 5 years ago

Thank you!

We should probably consider adopting an .editorconfig for the project...

M4444 commented 5 years ago

How did you test the script without knowing the path?

Br1ght0ne commented 5 years ago
$ tcsh
$ cd completions
$ source tmatrix-completion.csh
Br1ght0ne commented 5 years ago

When one - is typed it should also complete suggest completions for with --.

This is not easy with tcsh for two reasons:

First point is the key here: tcsh won't help you to find arguments through a list of possibilities, it just helps you to type the argument you already knew faster.

Surely, I could do something like adding -- to tmatrix_short_options, but it would change nothing in tcsh's behaviour with these completions loaded.

Br1ght0ne commented 5 years ago

There seems to be no "default" path for tcsh completions. Users are supposed to put their completions wherever they fancy and source them in ~/.tcshrc.

Here's an excerpt from git-completion.tcsh:

# To use this completion script:
#
#    0) You need tcsh 6.16.00 or newer.
#    1) Copy both this file and the bash completion script to ${HOME}.
#       You _must_ use the name ${HOME}/.git-completion.bash for the
#       bash script.
#       (e.g. ~/.git-completion.tcsh and ~/.git-completion.bash).
#    2) Add the following line to your .tcshrc/.cshrc:
#        source ~/.git-completion.tcsh

So we can do something like ${HOME}/.tmatrix-completion.tcsh and instruct users to source it by themselves.

M4444 commented 5 years ago

In that case we can do it in a similar way, just adding a comment instead of CMake commands. I think the 0th point can be dropped because it's not that important and their tcsh completion seems to be tied to the bash completion so that can also be cleared out.

M4444 commented 5 years ago

Thanks for the contribution :)