fix: unbound 'example' in config editor under set -u
Under 'set -u', 'local field=$1 key flags desc rest example' leaves the unassigned locals UNSET rather than empty, so any POS_CONFIG key without an '::example' hint (e.g. the whole system scope) hit 'example: unbound variable' and aborted the scope listing. Initialize all locals explicitly.
This commit is contained in:
+1
-1
@@ -90,7 +90,7 @@ cfg_scope_envfile() {
|
||||
# The optional example is "desc::example" — a literal "::" separates the
|
||||
# value-format hint from the description.
|
||||
_cfg_key_line() {
|
||||
local field="$1" key flags desc rest example
|
||||
local field="$1" key="" flags="" desc="" rest="" example=""
|
||||
key="${field%%=*}"
|
||||
if [[ "$field" == *"="* ]]; then
|
||||
rest="${field#*=}"
|
||||
|
||||
Reference in New Issue
Block a user