jshn: add json_get_keys()

Signed-off-by: Felix Fietkau <nbd@openwrt.org>
This commit is contained in:
Felix Fietkau 2013-10-20 00:00:42 +02:00
parent 734d28eb1a
commit 4bc1a3a46b

View file

@ -205,6 +205,15 @@ json_get_type() {
eval "export -- \"$__dest=\${$__var}\"; [ -n \"\${$__var+x}\" ]"
}
json_get_keys() {
local __dest="$1"
local _tbl_cur
json_get_var _tbl_cur "$2"
local __var="${JSON_PREFIX}KEYS_${_tbl_cur}"
eval "export -- \"$__dest=\${$__var}\"; [ -n \"\${$__var+x}\" ]"
}
json_get_var() {
local __dest="$1"
local __cur