tsch: tab-complete filename after --flag=

0

One the small annoyances I have in my daily use of tcsh is when I start writing a command like this:

# do_stuff --input=/path/to/some

I wish to use tab-completion to finish writing /path/to/some/file. Is there any way to make tcsh ignore the --input= part and allow tab completion here?

Rodin

Posted 2015-04-02T07:47:00.317

Reputation: 105

Answers

1

$ complete do_stuff 'c/input=/f/' 'p/*/(--input)/=' 

The first part is to complete filenames after input= (f flag), the second part is to complete --input and append a =.

Martin Tournoij

Posted 2015-04-02T07:47:00.317

Reputation: 303

That is already helpful. Is there any way to do this for the general case? – Rodin – 2015-04-09T11:09:49.520

1@Rodin What do you mean with 'the general case'? By the way, almost all commands allow you to write do_stuff --input /path/to/some. You almost never need the =. – Martin Tournoij – 2015-04-09T11:12:49.413

By general case, I mean, if I have an additional command do_other_stuff --foo=/path/to/some, do I need to write another rule? Or can a rule be written in a general way to cover both cases? – Rodin – 2015-04-09T11:19:57.183

If I don't need the =, this problem would just disappear.... you just made my day :) – Rodin – 2015-04-09T11:20:25.327