瀏覽代碼

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 <[email protected]>
Felix Fietkau 7 月之前
父節點
當前提交
6296c17026
共有 1 個文件被更改,包括 1 次插入2 次删除
  1. 1 2
      package/utils/cli/files/usr/share/ucode/cli/types.uc

+ 1 - 2
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)