#!/bin/sh

case "$BKJS_CMD" in

  help|get-help)
    echo ""
    echo "  get-json - read JSON from the input and show it nicely formatted"
    echo "  get-jsval FILE PROP [DFLT] [realpath] - return a value from a JSON file by property name"
    ;;

  get-json)
    exec node -e "console.log(util.inspect(JSON.parse(fs.readFileSync(0).toString()),null,null))"
    ;;

  get-jsval)
    echo $(get_json_flat "$BKJS_ARGV0" "$BKJS_ARGV1" "$BKJS_ARGV2" "$BKJS_ARGV3")
    exit
    ;;

esac

