For variables, act points to a member method which looks up the variable name
in another map and does stuff to it. The parameter to action is the complete
command line.

To have the command completion, you need to find the set of possible commands
and variables that start with what is already on the command line and then
find the longest string that they have in common at their beginning. The
following is called with the command so far when the user presses tab and
returns a string that should be appended to the command line:

ss cmd;
if(ss arg) // there is more than just a command
return ""; // filename completion omitted for brevity
len=cmd.length(); // how much to go on
while(ci != commands.end()){
thisone=ci-first.substr(0, len);

If you want this code, take the algorithm. The code is from my engine which
is under the LGPL so you might not want to just copy & paste.

If you want it a little simpler, be like Quake and just fill in the first
command that matches. But I find that much more annoying than the tcsh-style
behaviour - it always fills in something you don't expect.

William Brodie-Tyrrell

The zip file viewer built into the Developer Toolbox made use
of the zlib library, as well as the zlibdll source additions.