diff options
author | Patrick Spek <p.spek@tyil.nl> | 2022-09-26 11:25:21 +0200 |
---|---|---|
committer | Patrick Spek <p.spek@tyil.nl> | 2022-09-26 11:25:21 +0200 |
commit | e6d0cd45e243fe735ecb54dc1da528057724dd88 (patch) | |
tree | 02ad3f093691521070abce5fb7d2630d3ab10d20 | |
parent | 98768c0ca446f3202ce4d3e79eb68e463f11c156 (diff) | |
download | bashtard-e6d0cd45e243fe735ecb54dc1da528057724dd88.tar.gz bashtard-e6d0cd45e243fe735ecb54dc1da528057724dd88.tar.bz2 |
Update config_subkeys to only return the first level of subkey
-rw-r--r-- | lib/util/config.bash | 4 |
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 |