comparison 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
comparison
equal deleted inserted replaced
197:82957c407577 198:d2bed389e94a
175 printf("\n "); 175 printf("\n ");
176 col = 7; 176 col = 7;
177 } 177 }
178 if (llist[i] -> flags & lw_cmdline_opt_doc) 178 if (llist[i] -> flags & lw_cmdline_opt_doc)
179 { 179 {
180 printf(" [%s%s]", llist[i] -> name, llist[i] -> arg); 180 printf(" [%s=%s]", llist[i] -> name, llist[i] -> arg);
181 t = strlen(llist[i] -> name) + strlen(llist[i] -> arg) + 3; 181 t = strlen(llist[i] -> name) + strlen(llist[i] -> arg) + 3;
182 } 182 }
183 else 183 else
184 { 184 {
185 printf(" [--%s%s=%s%s]", 185 printf(" [--%s%s=%s%s]",
305 if (llist[i] -> flags & lw_cmdline_opt_optional) 305 if (llist[i] -> flags & lw_cmdline_opt_optional)
306 { 306 {
307 col++; 307 col++;
308 fputc('[', stdout); 308 fputc('[', stdout);
309 } 309 }
310 if (noequ) 310 if (!noequ)
311 { 311 {
312 fputc('=', stdout); 312 fputc('=', stdout);
313 col++; 313 col++;
314 } 314 }
315 printf("%s", llist[i] -> arg); 315 printf("%s", llist[i] -> arg);