projects
/
oweals
/
libubox.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
734d28e
)
jshn: add json_get_keys()
author
Felix Fietkau
<nbd@openwrt.org>
Sat, 19 Oct 2013 22:00:42 +0000
(
00:00
+0200)
committer
Felix Fietkau
<nbd@openwrt.org>
Sat, 19 Oct 2013 22:00:42 +0000
(
00:00
+0200)
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
sh/jshn.sh
patch
|
blob
|
history
diff --git
a/sh/jshn.sh
b/sh/jshn.sh
index b4bb1e13a8cc12e849d702a97fba1c06241d01ce..110892cba29ba2d9ee60e7742851cf37040a685b 100644
(file)
--- a/
sh/jshn.sh
+++ b/
sh/jshn.sh
@@
-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