From 6296c17026424b0fc3ca4d67ed4a649e38265849 Mon Sep 17 00:00:00 2001 From: Felix Fietkau Date: Tue, 20 May 2025 20:52:01 +0200 Subject: [PATCH] cli: return the correct data type for enum attributes Return entries from the value array instead of the provided string Signed-off-by: Felix Fietkau --- package/utils/cli/files/usr/share/ucode/cli/types.uc | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/package/utils/cli/files/usr/share/ucode/cli/types.uc b/package/utils/cli/files/usr/share/ucode/cli/types.uc index def3b12d919..10b004d1ad0 100644 --- a/package/utils/cli/files/usr/share/ucode/cli/types.uc +++ b/package/utils/cli/files/usr/share/ucode/cli/types.uc @@ -70,8 +70,7 @@ const types = { val = lc(val); val = filter(list, (v) => val == lc(v))[0]; } else { - if (index(list, val) < 0) - val = null; + val = filter(list, (v) => val == v)[0]; } if (val == null)