I have a function 'cs' that roughly looks like 'cd /some/prefix/$*', that I would like to have completion for. Any tips? (For some reason, non-trivial completions never seem to want to work for me :-(.)

IOW, if /some/prefix has the directories 'foo' and 'bar', I would like:
$ cs b<tab>
...to complete to...
$ cs bar

I've tried this and it doesn't work:
complete -C 'cd /some/prefix && compgen -d "$@"' cs

In fact, this doesn't seem to work either, meaning, generates no completions:
complete -C 'compgen -d' cs
...which implies that either the doc fails to explain how to use 'complete -C', or else it just plain doesn't work.

Note that compgen works as expected, I just can't get anything to work with 'complete -C'.

--
Matthew
For great justice!! -- Captain (Zero Wing)



Reply via email to