summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorHolger Schurig <holgerschurig@gmail.com>2014-05-30 11:07:30 +0200
committerSascha Hauer <s.hauer@pengutronix.de>2014-06-02 09:07:12 +0200
commit9b57fd27f520700154f294bd122a72ef052fef7b (patch)
treedbd3161e995346c4cb3a58e231397d95a2128f08 /lib
parent287c03267ebf5c5c4fea5b3d1e2bf53a838bfb19 (diff)
downloadbarebox-9b57fd27f520700154f294bd122a72ef052fef7b.tar.gz
barebox-9b57fd27f520700154f294bd122a72ef052fef7b.tar.xz
parameters: only show possible enumerations if there are any
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@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'lib')
-rw-r--r--lib/parameter.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/parameter.c b/lib/parameter.c
index baa2b156c0..b1f9aa3a49 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++) {