diff mbox series

[3/4] jshn.sh: Name positional arguments

Message ID mailman.44920.1746395808.1866309.openwrt-devel@lists.openwrt.org
State New
Headers show
Series [1/4] jshn.sh: Send warnings to stderr | expand

Commit Message

Philip Prindeville May 4, 2025, 9:56 p.m. UTC
The sender domain has a DMARC Reject/Quarantine policy which disallows
sending mailing list messages using the original "From" header.

To mitigate this problem, the original message has been wrapped
automatically by the mailing list software.
From: Philip Prindeville <philipp@redfish-solutions.com>

Document the positional arguments to functions, and then use
those named variables inside the functions.

Signed-off-by: Philip Prindeville <philipp@redfish-solutions.com>
---
 sh/jshn.sh | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)
diff mbox series

Patch

diff --git a/sh/jshn.sh b/sh/jshn.sh
index 3657642fd7673eeb417b0148af3e0b7c1e5c0825..c10ff3f154353c9a39b6b8ea9646464211450d86 100644
--- a/sh/jshn.sh
+++ b/sh/jshn.sh
@@ -222,6 +222,7 @@  json_dump() {
 }
 
 json_get_type() {
+	# target=$2
 	local __dest="$1"
 	local __cur
 
@@ -291,11 +292,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"
@@ -316,6 +317,8 @@  json_select() {
 }
 
 json_is_a() {
+	# target=$1
+	# type=$2
 	local type
 
 	json_get_type type "$1"