From e6d0cd45e243fe735ecb54dc1da528057724dd88 Mon Sep 17 00:00:00 2001
From: Patrick Spek
Date: Mon, 26 Sep 2022 11:25:21 +0200
Subject: Update config_subkeys to only return the first level of subkey
---
lib/util/config.bash | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
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
--
cgit v1.1