On Wed, Apr 22, 2009 at 9:52 PM, Steven Watanabe <watanabesj@gmail.com> wrote:
AMDG


Brian Davis wrote:
 4.  If the shell command needs to invoke a filter program handling
   
stdin and stdout pipes rather than a typical command-line program that
takes file names as arguments, how should such a filter action be
defined?


     
I have never done this, but you may find what you are looking for in:

boost_1_38_0/tools/build/v2/tools/testing.jam

see rule:

# Runs executable 'sources' and stores stdout in file 'target'. Unless
# --preserve-test-targets command line option has been specified, removes
the
# executable. The 'target-to-remove' parameter controls what should be
removed:
#   - if 'none', does not remove anything, ever
#   - if empty, removes 'source'
#   - if non-empty and not 'none', contains a list of sources to remove.
#
rule capture-output ( target : source : properties * : targets-to-remove * )
...
...


It looks as though you would need to create a rule not an action (though
this may be possible) to capture stdio or stdin.  I would hope others that
know more than I would weigh in on this.  I am unsure if this can be done in
a action, but I have *limited* knowledge.
 

This isn't quite right.  An action is a group of commands to be executed
by the shell.  A rule is jam code.  The rule for testing.capture-output
sets up variables needed by the action.


Yes action is what actually gets called at the shell, but a rule is also needed to call the action where stdio (stdout/stdin) can be captured and parsed correct?  Is there a way to capture stdio within a action?

Brian