[ts-gen] Latest release, scripting, shell-bang (shebang) lines
pippin at owlriver.net
Tue Jan 15 17:07:21 EST 2008
I've pushed a new release, and it should be visible in about an hour or so.
The cmd input language of the shim has been modified to include '#' style
comments, since I wanted to be able to have the shim take cmd input from
script files as well as the stdin.
Non-command input (whitespace and comments) is a new and unfinished feature,
and still flaky. Nevertheless, given some questions on the mailing list
about how to use the shim to download history and tick data, I've gone ahead
and pushed a release as well, so that others can use this feature.
Scripted input isn't much use for orders, since there isn't any control flow
in the cmd language. For regression tests --- my use --- and simple data
collection tasks, however, it seems useful.
So, there is now an optional file spec, which, when it occurs, is *prior* to
the required mode, what used to always be the first cmd line argument.
E.g., with the shim executable in the current directory, both of the command
lines below are valid, with the first accepting command input from stdin, and
the second from a file named "input.tsd". (The symbol "---script" is a
synonym for "-f", and either will work.)
./shim --data file save cout
./shim ---script input.tsd --data file save cout
Since the constant first arg of the file spec occupies the first arg slot,
if any, then the shim can also be used directly as a command interpreter for
interpreter files, so that executable scripts beginning with an awk-style
shell bang line will run as you would expect:
The tokenizer for whitespace and comments is still quirky, so don't be
surprised if you need to insert extra ping commands here and there to
resync the parser; if problems are critical, feel free to report them.
I may or may not be able to get to them right away, since this was all
in support of ongoing work on control of orders, but I will in any case
respond on the mailing list.
More information about the ts-general