From dde498a9a1a6bec031d2fb136282f4af66e766c4 Mon Sep 17 00:00:00 2001 From: Matthias Kruk Date: Thu, 20 May 2021 09:55:14 +0900 Subject: [PATCH] include/opt: Work around bug in old bash versions Declaring a non-local array and initializing it in the same statement causes it to become local in older bash versions. This commit works around this bug by removing the array initializations from internal arrays of the opt module. --- include/opt.sh | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/include/opt.sh b/include/opt.sh index a654502..ea67f7f 100644 --- a/include/opt.sh +++ b/include/opt.sh @@ -8,14 +8,14 @@ __init() { declare -xgir __opt_flag_required=1 declare -xgir __opt_flag_has_value=2 - declare -Axg __opt_short=() - declare -Axg __opt_long=() - declare -Axg __opt_desc=() - declare -Axg __opt_flags=() - declare -Axg __opt_value=() - declare -Axg __opt_default=() - declare -Axg __opt_action=() - declare -Axg __opt_map=() + declare -Axg __opt_short + declare -Axg __opt_long + declare -Axg __opt_desc + declare -Axg __opt_flags + declare -Axg __opt_value + declare -Axg __opt_default + declare -Axg __opt_action + declare -Axg __opt_map declare -xgi __opt_num=0 declare -xgi __opt_longest=0 -- 2.47.3