I'm using compgen and complete to generate a list of client names for some functions that I use.
Code:
function complj()
{
COMPREPLY=()
curw=${COMP_WORDS[COMP_CWORD]}
COMPREPLY=($(compgen -W '$arglist' -- $curw))
return 0
}
Then I use the following to "provide" the completion list to my functions
Code:
complete -F complj -o "nospace" "feeds"
What I'd like to do is make it so if I'm running any script that same list would be available to that script as arguments.
I've tried variations of the following
Code:
complete -F complj -o "nospace" "bash"
complete -F complj -o "nospace" "/bin/bash"
complete -F complj -o "nospace" "./"
but none work, and I know it's me at fault.
Even after reading the man page I'm just not getting it.
Any suggestions/examples/further research material that anyone might suggest?
Thanks!