aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPatrick Spek <p.spek@tyil.nl>2022-09-26 11:25:21 +0200
committerPatrick Spek <p.spek@tyil.nl>2022-09-26 11:25:21 +0200
commite6d0cd45e243fe735ecb54dc1da528057724dd88 (patch)
tree02ad3f093691521070abce5fb7d2630d3ab10d20
parent98768c0ca446f3202ce4d3e79eb68e463f11c156 (diff)
Update config_subkeys to only return the first level of subkey
-rw-r--r--lib/util/config.bash4
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/util/config.bash b/lib/util/config.bash
index eecc31a..78841e1 100644
--- a/lib/util/config.bash
+++ b/lib/util/config.bash
@@ -111,7 +111,9 @@ config_subkeys_for() {
while read -r result
do
- results+=("$result")
+ local subkey="$(awk -F. '{ print $1 }' <<< "${result#"$key."}")"
+ debug "bashtard/config_subkeys" "Found '$subkey' as subkey of '$key' through '$result'"
+ results+=("$subkey")
done < <(grep "^$key\." "$file" | awk -F= '{ print $1 }')
done