vlc | branch: master | Rémi Denis-Courmont <[email protected]> | Wed Aug 20 20:09:02 2014 +0300| [f8d541e6e0bff4d7fb7e7f1f8dc368ed2617e597] | committer: Rémi Denis-Courmont
help: print the boolean default once and on a separate line This avoids wrapping in the middle of it and having a parenthesis after a full point. > http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=f8d541e6e0bff4d7fb7e7f1f8dc368ed2617e597 --- src/config/help.c | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/src/config/help.c b/src/config/help.c index 6baf594..aa1a6af 100644 --- a/src/config/help.c +++ b/src/config/help.c @@ -351,7 +351,7 @@ static void print_item(const module_t *m, const module_config_t *item, # define OPTION_VALUE_SEP "=" #endif const char *bra = OPTION_VALUE_SEP "<", *type, *ket = ">"; - const char *prefix = NULL, *suffix = ""; + const char *prefix = NULL, *suffix = NULL; char psz_buffer[10000]; // XXX switch (CONFIG_CLASS(item->i_type)) @@ -432,8 +432,8 @@ static void print_item(const module_t *m, const module_config_t *item, case CONFIG_ITEM_BOOL: bra = type = ket = ""; prefix = ", --no-"; - suffix = item->value.i ? _(" (default enabled)") - : _(" (default disabled)"); + suffix = item->value.i ? _("(default enabled)") + : _("(default disabled)"); break; default: return; @@ -467,17 +467,22 @@ static void print_item(const module_t *m, const module_config_t *item, putchar('\n'); offset = PADDING_SPACES + LINE_START; } + printf("%*s", offset, ""); + print_desc(module_gettext(m, item->psz_longtext), + PADDING_SPACES + LINE_START, color); - sprintf(psz_buffer, "%s%s", module_gettext(m, item->psz_text), suffix); - print_desc(psz_buffer, PADDING_SPACES + LINE_START, color); + if (suffix != NULL) + { + printf("%*s", offset, ""); + print_desc(suffix, PADDING_SPACES + LINE_START, color); + } if (desc && (item->psz_longtext != NULL && item->psz_longtext[0])) { /* Wrap long description */ printf("%*s", LINE_START + 2, ""); - sprintf(psz_buffer, "%s%s", module_gettext(m, item->psz_longtext), - suffix); - print_desc(psz_buffer, LINE_START + 2, false); + print_desc(module_gettext(m, item->psz_longtext), + LINE_START + 2, false); } } _______________________________________________ vlc-commits mailing list [email protected] https://mailman.videolan.org/listinfo/vlc-commits
