From 683e5e98f3babdf68a07ec4db2aaace72953d289 Mon Sep 17 00:00:00 2001 From: Arnaud Giersch Date: Fri, 13 Sep 2013 17:48:20 +0200 Subject: [PATCH] Improve printing of boolean values with --cfg-help. Some values are rather strange... --- src/xbt/config.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/xbt/config.c b/src/xbt/config.c index cf6c778f49..0c00bcd7df 100644 --- a/src/xbt/config.c +++ b/src/xbt/config.c @@ -412,9 +412,16 @@ void xbt_cfg_help(xbt_cfg_t cfg) printf("'%s'%s", xbt_dynar_get_as(variable->content, i, char *), sep); break; - case xbt_cfgelm_boolean: - printf("'%d'%s", xbt_dynar_get_as(variable->content, i, int), sep); + case xbt_cfgelm_boolean: { + int b = xbt_dynar_get_as(variable->content, i, int); + const char *bs = b ? xbt_cfgelm_boolean_values[0].true_val + : xbt_cfgelm_boolean_values[0].false_val; + if (b == 0 || b == 1) + printf("'%s'%s", bs, sep); + else + printf("'%s/%d'%s", bs, b, sep); break; + } case xbt_cfgelm_peer: { xbt_peer_t hval = xbt_dynar_get_as(variable->content, i, xbt_peer_t); -- 2.20.1