From: John Koleszar Date: Thu, 21 Oct 2010 20:53:52 +0000 (-0400) Subject: usage: fix horizontal alignment of options X-Git-Tag: v0.9.5~22^2~5 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=dea6193d093df79a191350fedf52577d2e269804;p=libvpx usage: fix horizontal alignment of options When showing the command usage information for vpxenc and vpxdec, options with both a short and long version that do not take an argument were not properly aligned. Change-Id: I8d65b5ab85bcb5a5dc8bc0d4b293b5189d56dedb --- diff --git a/args.c b/args.c index 5365e9120..782929022 100644 --- a/args.c +++ b/args.c @@ -120,9 +120,13 @@ void arg_show_usage(FILE *fp, const struct arg_def *const *defs) char *long_val = def->has_val ? "=" : ""; if (def->short_name && def->long_name) - snprintf(option_text, 37, "-%s%s, --%s%s", - def->short_name, short_val, + { + char *comma = def->has_val ? "," : ", "; + + snprintf(option_text, 37, "-%s%s%s --%s%6s", + def->short_name, short_val, comma, def->long_name, long_val); + } else if (def->short_name) snprintf(option_text, 37, "-%s%s", def->short_name, short_val);