Search code examples
shelltcsh

Extending tcsh completion


I must work with tcsh. I am using an internal tool that provides basic completion for some of its commands. I would like to extend the completion.

I mean that in future releases the default completion may evolve.

I tried something like this: set def_cmpl = complete tool

complete tool $def_cmpl 'n/-l/(reg short long gui)/'

But I don't understand the result I get. Indeed, the quotes inside $def_cmpl are doubled:

tcsh> complete tool
''n@-t@$script@'' n/-l/(reg short long gui)/'

I tried some tricks with echo, sed, etc. but I can't avoid those ''.

Could somebody help me? Please don't say go on bash... The tool doesn't support it...


Solution

  • Finally, I did not find a solution to keep the data inside the script. So, the solution was to redirect the output of the complete command inside a file and then to append new lines to the file.