projects
/
project
/
libubox.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
jshn.sh: add json_get_vars() wrapper function
[project/libubox.git]
/
sh
/
jshn.sh
diff --git
a/sh/jshn.sh
b/sh/jshn.sh
index
8ecefcf
..
117da67
100644
(file)
--- a/
sh/jshn.sh
+++ b/
sh/jshn.sh
@@
-100,10
+100,17
@@
json_get_type() {
json_get_var() {
local dest="$1"
json_get_var() {
local dest="$1"
- local var="$
2
"
+ local var="$
(echo -n "$2" | tr -C '[a-zA-Z_]' _)
"
eval "export -- \"$dest=\${${JSON_CUR}_$var}\""
}
eval "export -- \"$dest=\${${JSON_CUR}_$var}\""
}
+json_get_vars() {
+ while [ "$#" -gt 0 ]; do
+ local _var="$1"; shift
+ json_get_var "$_var" "$_var"
+ done
+}
+
json_select() {
local target="$1"
local type
json_select() {
local target="$1"
local type