Visit Jeremy's Blog.
Go Back > Forums > Non-*NIX Forums > Programming
User Name
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.


  Search this Thread
Old 06-11-2004, 02:19 PM   #1
Senior Member
Registered: Mar 2002
Location: Los Angeles, CA
Distribution: Debian, Ubuntu
Posts: 1,334

Rep: Reputation: 51
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.

Old 06-11-2004, 04:51 PM   #2
LQ Guru
Registered: Mar 2004
Distribution: Slackware
Posts: 6,552

Rep: Reputation: 872Reputation: 872Reputation: 872Reputation: 872Reputation: 872Reputation: 872Reputation: 872
If you want to do this with script try perl cpan module Term::Complete.

do perldoc Term::Complete for more infos


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
auto-completion in idle/idlefork? Guest1234 Programming 1 08-28-2005 04:13 PM
Is there a script to auto find installed distros & edit Grub clintbrot Linux - Software 3 06-16-2005 10:15 PM
auto-completion in bash with wildcards juanbobo Linux - Software 2 04-07-2005 12:56 AM
Terminal auto-completion - stopping speaker noise bb_matt Linux - General 3 01-06-2004 10:15 PM
bash auto-complete behaviour changes acid_kewpie Linux - Software 5 10-26-2002 01:32 PM > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 12:01 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration