Explorar el Código

cli: fix showing empty lists

Display <none> as value instead of hiding the attribute name

Signed-off-by: Felix Fietkau <[email protected]>
Felix Fietkau hace 9 meses
padre
commit
a46a55b407
Se han modificado 1 ficheros con 2 adiciones y 0 borrados
  1. 2 0
      package/utils/cli/files/usr/sbin/cli

+ 2 - 0
package/utils/cli/files/usr/sbin/cli

@@ -345,6 +345,8 @@ function format_multiline(prefix, val)
 
 	if (type(val) != "array")
 		val = [ val ];
+	if (length(val) == 0)
+		val = [ "<none>" ];
 
 	for (let cur in val) {
 		cur = format_entry(cur);