diff lwlib/lw_cmdline.c @ 198:d2bed389e94a

Fix --help and --usage to display = correctly for long option args --usage and --help were missing the = between the long option and its argument in certain circumstances. Correct lwlib to handle these cases.
author William Astle <lost@l-w.ca>
date Thu, 15 Mar 2012 09:33:26 -0600
parents 8ae2670377ca
children 806e5fc6dd93
line wrap: on
line diff
--- a/lwlib/lw_cmdline.c	Thu Mar 15 09:27:48 2012 -0600
+++ b/lwlib/lw_cmdline.c	Thu Mar 15 09:33:26 2012 -0600
@@ -177,7 +177,7 @@
 			}
 			if (llist[i] -> flags & lw_cmdline_opt_doc)
 			{
-				printf(" [%s%s]", llist[i] -> name, llist[i] -> arg);
+				printf(" [%s=%s]", llist[i] -> name, llist[i] -> arg);
 				t = strlen(llist[i] -> name) + strlen(llist[i] -> arg) + 3;
 			}
 			else
@@ -307,7 +307,7 @@
 				col++;
 				fputc('[', stdout);
 			}
-			if (noequ)
+			if (!noequ)
 			{
 				fputc('=', stdout);
 				col++;