Boost logo

Boost-Build :

Subject: Re: [Boost-build] string manipulation
From: aaron_at_[hidden]
Date: 2016-10-13 16:30:40


> Thanks, that works. How can I capture errors using the SHELL command,
> i.e. handle cases where `path/to/tool.py`either returns an error or
> writes to stderr (or both) ?
 
There isn't a way to get the stderr, but you can have the exit code returned by passing
"exit-status" as an optional parameter. This will return a list of two items: the stdout and
the error code
 
local result = [ SHELL path/to/tool.py : strip-eol exit-status ] ;
local output = $(result[1]) ;
local status = $(result[2]) ;
 
This option is documented here:
http://www.boost.org/build/doc/html/jam/language.html#jam.language.rules.builtins.utility._shell__



Boost-Build list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk