[PATCH 04/10] parameters: only show possible enumerations if there are any

Holger Schurig holgerschurig at gmail.com
Fri May 30 02:07:30 PDT 2014


Enumeration values will only be shown if there are at least two of them.
With only one enumeration, it was just repeating what was previously printed
anyway.

Signed-off-by: Holger Schurig <holgerschurig at gmail.com>
---
 lib/parameter.c |    3 +++
 1 file changed, 3 insertions(+)

diff --git a/lib/parameter.c b/lib/parameter.c
index baa2b15..b1f9aa3 100644
--- a/lib/parameter.c
+++ b/lib/parameter.c
@@ -362,6 +362,9 @@ static void param_enum_info(struct param_d *p)
 	struct param_enum *pe = to_param_enum(p);
 	int i;
 
+	if (pe->num_names <= 1)
+		return;
+
 	printf(" (");
 
 	for (i = 0; i < pe->num_names; i++) {
-- 
1.7.10.4




More information about the barebox mailing list