mirror of
https://github.com/albfan/bash-ini-parser.git
synced 2025-04-19 13:22:14 +03:00
Better debug messages
This commit is contained in:
parent
9368387ce8
commit
f19ab7e76b
@ -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++))
|
||||
|
Loading…
x
Reference in New Issue
Block a user