- fprintf(outf, "%s%s", (flags & USAGE_LISTING) ? " " : "usage: ",
- *usagestr++);
+ if (flags & USAGE_LISTING)
+ prefix = pad_listing;
+
+ fputs(prefix, outf);
+ if (strchr(*usagestr, '\n') == NULL) {
+ fputs(*usagestr, outf);
+ } else {
+ const char *c = *usagestr;
+ const char *nprefix = " ";
+
+ if (flags & USAGE_LISTING)
+ nprefix = pad_listing;
+
+ for (c = *usagestr; *c; c++) {
+ fputc(*c, outf);
+ if (*c == '\n')
+ fputs(nprefix, outf);
+ }
+ }
+ usagestr++;