From dea6193d093df79a191350fedf52577d2e269804 Mon Sep 17 00:00:00 2001 From: John Koleszar Date: Thu, 21 Oct 2010 16:53:52 -0400 Subject: [PATCH] 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 --- args.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) 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); -- 2.40.0