summaryrefslogtreecommitdiffstats
path: root/docs
diff options
context:
space:
mode:
authorNicolas Williams <nico@cryptonector.com>2017-02-22 23:01:56 -0600
committerNicolas Williams <nico@cryptonector.com>2017-02-26 16:34:56 -0600
commit8ea21a54adfa9e518f4855d2dc06ae3c0456d69c (patch)
tree1a4636dd292d73d5ac31827ffe9d63d7c0a5e0f2 /docs
parent6bac4ed059966007a6bc0e4a3639aca7d59f3b10 (diff)
Add `halt`, `halt_error` builtins (fix #386)
Diffstat (limited to 'docs')
-rw-r--r--docs/content/3.manual/manual.yml23
1 files changed, 22 insertions, 1 deletions
diff --git a/docs/content/3.manual/manual.yml b/docs/content/3.manual/manual.yml
index cadc6fbd..fa23e355 100644
--- a/docs/content/3.manual/manual.yml
+++ b/docs/content/3.manual/manual.yml
@@ -209,6 +209,9 @@ sections:
problem or system error, 3 if there was a jq program compile
error, or 0 if the jq program ran.
+ Another way to set the exit status is with the `halt_error`
+ builtin function.
+
* `--arg name value`:
This option passes a value to the jq program as a predefined
@@ -982,7 +985,25 @@ sections:
Produces an error, just like `.a` applied to values other than
null and objects would, but with the given message as the
- error's value.
+ error's value. Errors can be caught with try/catch; see below.
+
+ - title: "`halt`"
+ body: |
+
+ Stops the jq program with no further outputs. jq will exit
+ with exit status `0`.
+
+ - title: "`halt_error`, `halt_error(exit_code)`"
+ body: |
+
+ Stops the jq program with no further outputs. The input will
+ be printed on `stderr` as raw output (i.e., strings will not
+ have double quotes) with no decoration, not even a newline.
+
+ The given `exit_code` (defaulting to `5`) will be jq's exit
+ status.
+
+ For example, `"Error: somthing went wrong\n"|halt_error(1)`.
- title: "`$__loc__`"
body: |