alef 0.115.0

Opinionated polyglot binding generator for Rust libraries
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
  local val_{{ identifier }}
  if ! val_{{ identifier }}=$(
    jq -r -s '
      if length == 1 then .[0] | ({{ jq_path }}) else error("expected one JSON result") end
    ' <<<"$output" || exit "$?"
    printf '.'
  ); then
    printf '%s\n' 'FAIL [{{ field }}]: cannot extract JSON value' >&2
    return 1
  fi
  val_{{ identifier }}=${val_{{ identifier }}%.}
  val_{{ identifier }}=${val_{{ identifier }}%$'\n'}