Index: benchmark/io/http/parseargs.cfa
===================================================================
--- benchmark/io/http/parseargs.cfa	(revision 03ed8632f740428dbb3a3a1b05c4820e3375d3a0)
+++ benchmark/io/http/parseargs.cfa	(revision b0a0ee4e6d49fbba76a24cff5e7e4191d56ea00e)
@@ -3,7 +3,10 @@
 // #include <stdio.h>
 // #include <stdlib.h>
+#include <errno.h>
 #include <string.h>
+#include <unistd.h>
 extern "C" {
 	#include <getopt.h>
+	#include <sys/ioctl.h>
 
 	struct FILE;
@@ -11,8 +14,25 @@
 	extern FILE * stdout;
 
+	extern int fileno(FILE *stream);
+
 	extern int fprintf ( FILE * stream, const char * format, ... );
 
 	extern          long long int strtoll (const char* str, char** endptr, int base);
 	extern unsigned long long int strtoull(const char* str, char** endptr, int base);
+}
+
+#include <common.hfa>
+#include <limits.hfa>
+
+void printopt(FILE * out, int width, int max, char sn, const char * ln, const char * help) {
+	int hwidth = max - (11 + width);
+	if(hwidth <= 0) hwidth = max;
+
+	fprintf(out, "  -%c, --%-*s   %.*s\n", sn, width, ln, hwidth, help);
+	for() {
+		help += min(strlen(help), hwidth);
+		if('\0' == *help) break;
+		fprintf(out, "%*s%.*s\n", width + 11, "", hwidth, help);
+	}
 }
 
@@ -27,4 +47,5 @@
 	struct option optarr[opt_count + 2];
 	int width = 0;
+	int max_width = 1_000_000;
 	{
 		int idx = 0;
@@ -95,9 +116,17 @@
 	}
 
-	USAGE:
+	USAGE:;
+	int outfd = fileno(out);
+	if(isatty(outfd)) {
+		struct winsize size;
+		int ret = ioctl(outfd, TIOCGWINSZ, &size);
+		if(ret < 0) abort( "ioctl error: (%d) %s\n", (int)errno, strerror(errno) );
+		max_width = size.ws_col;
+	}
+
 	fprintf(out, "Usage:\n  %s %s\n", argv[0], usage);
 
 	for(i; opt_count) {
-		fprintf(out, "  -%c, --%-*s   %s\n", options[i].short_name, width, options[i].long_name, options[i].help);
+		printopt(out, width, max_width, options[i].short_name, options[i].long_name, options[i].help);
 	}
 	fprintf(out, "  -%c, --%-*s   %s\n", 'h', width, "help", "print this help message");
@@ -138,5 +167,5 @@
 	unsigned long long int r = strtoull(arg, &end, 10);
 	if(*end != '\0') return false;
-#warning not checking max
+	if(r > (unsigned)MAX) return false;
 
 	value = r;
@@ -148,5 +177,5 @@
 	unsigned long long int r = strtoull(arg, &end, 10);
 	if(*end != '\0') return false;
-#warning not checking max
+	if(r > (size_t)MAX) return false;
 
 	value = r;
