diff options
author | sinanmohd <sinan@firemail.cc> | 2023-08-02 16:12:03 +0530 |
---|---|---|
committer | sinanmohd <sinan@firemail.cc> | 2023-08-02 16:35:37 +0530 |
commit | 7258e85c6bcfa8ed34bd8b6250dff244775ac525 (patch) | |
tree | 47e89e6749deb001f0d0be49f1103ca5afb4c4d2 | |
parent | e4223ebcabbba82b92f8652e78d0c43db7507355 (diff) |
dbook: lazy evaluate value of keys
-rwxr-xr-x | dbook | 12 |
1 files changed, 6 insertions, 6 deletions
@@ -109,19 +109,19 @@ parse_data() [ -z "$line" ] && continue _key="${line%%|*}" - _value="${line##*|}" _key="$(trim "$_key")" - _value="$(trim "$_value")" case "$_key" in #*) continue esac if [ "$1" = "getval" ]; then - if [ "$2" = "$_key" ]; then - echo "$_value" - return 0 - fi + [ "$2" != "$_key" ] && continue + + _value="${line##*|}" + _value="$(trim "$_value")" + echo "$_value" + return 0 else echo "$(load_icon "$_value")" "$_key" fi |