diff options
| author | Philip Prindeville | 2023-09-15 19:53:02 +0000 |
|---|---|---|
| committer | Robert Marko | 2026-02-12 15:57:28 +0000 |
| commit | 5a65cb5a79b757d24beeab4144333b012a4935ec (patch) | |
| tree | 1a19f2ed38fe3fe48c670472ccb2435da286e2cf | |
| parent | d324c0503040914dd125298093c83fd07bf9f012 (diff) | |
| download | libubox-5a65cb5a79b757d24beeab4144333b012a4935ec.tar.gz | |
libubox: document positional arguments
Use local variables for positional arguments where they're captured,
and provide comments for position arguments.
Signed-off-by: Philip Prindeville <philipp@redfish-solutions.com>
Link: https://github.com/openwrt/libubox/pull/12
Signed-off-by: Robert Marko <robimarko@gmail.com>
| -rw-r--r-- | sh/jshn.sh | 7 |
1 files changed, 5 insertions, 2 deletions
@@ -236,6 +236,7 @@ json_dump() { } json_get_type() { + # target=$2 local __dest="$1" local __cur @@ -305,11 +306,11 @@ json_select() { local type local cur - [ -z "$1" ] && { + [ -z "$target" ] && { _json_set_var JSON_CUR "J_V" return 0 } - [[ "$1" == ".." ]] && { + [[ "$target" == ".." ]] && { _json_get_var cur JSON_CUR _json_get_var cur "U_$cur" _json_set_var JSON_CUR "$cur" @@ -330,6 +331,8 @@ json_select() { } json_is_a() { + # target=$1 + # type=$2 local type json_get_type type "$1" |