|
Boost-Build : |
From: David Abrahams (dave_at_[hidden])
Date: 2006-02-03 19:51:41
Rene Rivera <grafik.list_at_[hidden]> writes:
> I just checked in the changes I talked about earlier with regards to
> adding options to the SHELL/COMMAND builtin. In the process I also added
> to the EXIT builtin the ability to specify a result value to exit with.
> I needed it to be able to implement a very minimal unit test facility
> for testing the SHELL changes. QuickBook documentation for both is also
> updated:
>
> [pre
> rule EXIT ( /message/ * : /result-value/ ? )
> ]
Nitty:
I'm not sure you should italicize parameter names; it's just bjam
code. If you meant for them to be replaceable it would be
[pre
EXIT ( [~message] : [~result-value] )
]
or something, but then you wouldn't be writing it as a rule
declaration.
> Blurts out the /message/ to stdout and then exits with a failure status
> if no /result-value/ is given, otherwise it exits with the given
> /result-value/.
>
> "=Echo=", "=echo=", "=Exit=", and "=exit=" are accepted as aliases for
> =ECHO= and =EXIT=, since it is hard to tell that these are built-in
> rules and not part of the language, like "=include=".
Wouldn't that same logic hold for every builtin rule? Why are these
special?
> [pre
> rule SHELL ( /command/ : * )
> ]
>
> =SHELL= executes /command/, and then returns the standard output of
> /command/. =SHELL= only works on platforms with a =popen()= function in
> the C library. On platforms without a working =popen()= function,
> =SHELL= is implemented as a no-op. =SHELL= works on Unix, MacOS X, and
> most Windows compilers. =SHELL= is a no-op on Metrowerks compilers under
> Windows. There is a variable set of allowed options as additional arguments:
>
> [variablelist
> [[=exit-status=] [In addition to the output the result status of
> the executed command is returned as a second element of the result.]]
> [[=no-output=] [Don't capture the output of the command. Instead an
> empty ("") string value is returned in place of the output.]]
> ]
>
> Because the Perforce/Jambase defines a =Shell= rule which hides the
> builtin
Why would it? Jam is case sensitive.
-- Dave Abrahams Boost Consulting www.boost-consulting.com
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