[openwrt/openwrt] cli: return the correct data type for enum attributes
LEDE Commits
lede-commits at lists.infradead.org
Sat May 31 07:24:04 PDT 2025
nbd pushed a commit to openwrt/openwrt.git, branch main:
https://git.openwrt.org/6296c17026424b0fc3ca4d67ed4a649e38265849
commit 6296c17026424b0fc3ca4d67ed4a649e38265849
Author: Felix Fietkau <nbd at nbd.name>
AuthorDate: Tue May 20 20:52:01 2025 +0200
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 <nbd at nbd.name>
---
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 def3b12d91..10b004d1ad 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)
More information about the lede-commits
mailing list