From f19ab7e76b070b9853f6e31cf9de8119b8e7fc7a Mon Sep 17 00:00:00 2001 From: Alberto Fanjul Date: Fri, 28 Aug 2020 20:02:43 +0200 Subject: [PATCH] Better debug messages --- bash-ini-parser | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/bash-ini-parser b/bash-ini-parser index dd04653..4b198be 100755 --- a/bash-ini-parser +++ b/bash-ini-parser @@ -33,17 +33,17 @@ function cfg_parser { IFS=$'\n' && ini=( ${ini} ) # convert to line-array debug ini=( ${ini[*]/#*([[:space:]]);*/} ) - debug "remove ; comments" + debug "removed ; comments" ini=( ${ini[*]/#*([[:space:]])\#*/} ) - debug "remove # comments" + debug "removed # comments" ini=( ${ini[*]/#+([[:space:]])/} ) # remove init whitespace - debug + debug "removed initial whitespace" ini=( ${ini[*]/%+([[:space:]])/} ) # remove ending whitespace - debug "whitespace around =" + debug "removed ending whitespace" ini=( ${ini[*]/%+([[:space:]])\\]/\\]} ) # remove non meaningful whitespace after sections - debug "whitespace around =" + debug "removed whitespace after section name" ini=( ${ini[*]/*([[:space:]])=*([[:space:]])/=} ) # remove whitespace around = - debug + debug "removed space around =" ini=( ${ini[*]/#\\[/\}$'\n'"$PREFIX"} ) # set section prefix debug for ((i=0; i < "${#ini[@]}"; i++))