From eca55e60c29440c4e2e007b54ea1a1983e965954 Mon Sep 17 00:00:00 2001 From: davidovski Date: Thu, 1 Oct 2026 10:34:33 +0100 Subject: Add libhbar to shmk --- src/util/parseconf.sh | 42 +++++++++++++++++++++--------------------- 1 file changed, 21 insertions(+), 21 deletions(-) (limited to 'src/util/parseconf.sh') diff --git a/src/util/parseconf.sh b/src/util/parseconf.sh index d215a99..17cb0ce 100644 --- a/src/util/parseconf.sh +++ b/src/util/parseconf.sh @@ -1,37 +1,37 @@ #!/bin/sh usage () { - printf "Usage $0 " - echo << "EOF" +printf "Usage $0 " +echo << "EOF" OPTIONS... [FILTER] Print the parsed config file filtering by the keys Arguments: - -f file read configuration from a file, uses /dev/sdtin otherwise - -v only print values - -c n print the last [n] +-f file read configuration from a file, uses /dev/sdtin otherwise +-v only print values +-c n print the last [n] EOF } # parse a single config file line # parse_line() { - [ "$#" = 0 ] && return - - local line="$@" - local key=$1 - - shift - local value="$@" - value=${value%#*} - - case $key in - "include") - cat $value | parse - return - ;; - "]") - IFS=. +[ "$#" = 0 ] && return + +local line="$@" +local key=$1 + +shift +local value="$@" +value=${value%#*} + +case $key in + "include") + cat $value | parse + return + ;; + "]") + IFS=. set -- $list list="${*%${!#}}" IFS=" " -- cgit v1.2.3