auto-completion - how does it work & can my script args auto-complete?
I wrote a little job system that people at my office use. It essentially allows you to create a new job which just makes a bunch of directories and sets a bunch of variables; or switch between jobs which just changes the values of all the variables.
You create a job by typing "job -n foo" or you switch to a job by typing "job bar". In the latter case, the directory /job/bar exists, so I'd think it would be possible to auto-complete "bar" as the user types it. Is that possible? If so, how would you do it? My job system is just a simple tcsh script that gets sourced so the environment variables it sets stay set in the shell until the shell is closed (as opposed to when the script exits - if there's a better way, please let me know). I'm not opposed to writing the job system in another language either if that's the only way to get this working.... looking for suggestions.