summaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
authorkennyballou <kballou@onyx.boisestate.edu>2013-02-21 10:29:07 -0700
committerkennyballou <kballou@onyx.boisestate.edu>2013-02-21 10:29:07 -0700
commitb430fb92b9f02ba0f2b7407e9e3452475bd7991a (patch)
treeaa474e834868e99881340486deaf630e7e073e53 /docs
parentbca77f0a1a2c325978a5292b142d063037d68a4c (diff)
downloadxnt-b430fb92b9f02ba0f2b7407e9e3452475bd7991a.tar.gz
xnt-b430fb92b9f02ba0f2b7407e9e3452475bd7991a.tar.xz
Update return values section
Diffstat (limited to 'docs')
-rw-r--r--docs/source/buildfile.rst44
1 files changed, 38 insertions, 6 deletions
diff --git a/docs/source/buildfile.rst b/docs/source/buildfile.rst
index 58e226a..b57cbe0 100644
--- a/docs/source/buildfile.rst
+++ b/docs/source/buildfile.rst
@@ -73,10 +73,32 @@ Return Values
=============
The targets you define can return an error code (or '0' for success) however
-you see fit. Doing this will give you a status message at the end of the
-invocation of Xnt that will inform you if the target ran successfully or not
-given your criteria (or will just say it succeeded if you don't specify a
-return value at all). For example::
+you see fit. Xnt will emit 'Failure' if the status code is *not* zero and will
+otherwise remain silent if the code is zero. Further, the status code returned
+by your target will be returned as the exit code of Xnt when finished
+executing.
+
+*Notice*, this allows Xnt to fail fast when attempting to execute multiple
+targets. That is, if you specify more than one target, Xnt will stop at the
+first failure.
+
+If you don't define a return value for a target, Xnt will assume success and
+return '0'.
+
+Examples
+--------
+
+Not defining the return value::
+
+ @target
+ def foo():
+ pass
+
+Will result in (no success message; other output may be shown)::
+
+ ...
+
+Returning success (no success message; other output may be shown)::
@target
def foo():
@@ -85,9 +107,19 @@ return value at all). For example::
Will result in::
...
- Success
-Most tasks have been updated to return error codes as well to that you can
+Returning failure (not 0)::
+
+ @target
+ def foo():
+ return 1
+
+Will result in::
+
+ ...
+ Failure
+
+Most tasks have been updated to return error codes as well so that you can
return what it returns. If you find any tasks that can be updated to behave
this way, please create an issue for it.