p.f.moore wrote:
| When I'm testing a plugin, I regularly get caught out by the fact that
| plugins aren't automatically loaded into subshells, so that
|
| echo xxx | plugin_cmd
|
| fails (as the plugin isn't loaded on the RHS of the pipe.
|
| As it's a test situation, I don't want to put the plugin into my
| autostart. Of course I can do
|
| echo xxx | (plugin /L MyPlugin & plugin_cmd)
|
| but is there a simpler way? Something that says "load this plugin now,
| and autoload it for any shells spawned from this one"?
Remember, any plugins in subdirectory PLUGINS of the command processor
installation directory are automatically loaded for EACH instance of the
command processor (though in TCC you can suppress this with the /IP option
in the command which starts TCC).
Since I keep multiple versions of the command processors installed into a
set of directories, I keep all of my plugins in sets of "plugin master"
directories C:\JPSOFT\PLnn, where nn is the command processor version
number. Note that the actual .dll files, e.g. 4utils.dll, in these
directories are hard linked to one another if they work in all versions both
to save disk space and to simplify updating.
For each directory in which a plugin-capable command processor version is
installed I create a directory junction (soft link) from the appropriate
PLnn master directory to the local subdirectory PLUGINS, e.g.:
mklnk c:\jpsoft\pl09 c:\jpsoft\i9\plugins.
This ensures that all instances of TCC.EXE V9, unless started with the /IP
switch, have access to all plugins.
Having all pipe instances load all plugins slows pipes down very slightly
(since the .dll's are already loaded, so this involves only the dynamic
linking and plugin initialization). In all instances they also slow down the
parser. The presence of many aliases, environment variables, and user
defined functions also slow the parser down. Of course, every added internal
command, internal variable and environment function does that, too. In an
interpreted script this results in new features unavoidably slwoing down
execution. The price of progress. For general operation I am quite willing
to live with the slowdown. For special tasks I do start TCC with /L:/I to
run them faster.
--
HTH, Steve