Index: libcfa/src/parseargs.cfa
===================================================================
--- libcfa/src/parseargs.cfa	(revision a25bcf8ab29dde92e982540e533dcee4c347fd63)
+++ libcfa/src/parseargs.cfa	(revision 4af5396caad4605b138ead74b53857a746688724)
@@ -1,4 +1,21 @@
+//
+// Cforall Version 1.0.0 Copyright (C) 2022 University of Waterloo
+//
+// The contents of this file are covered under the licence agreement in the
+// file "LICENCE" distributed with Cforall.
+//
+// parseargs.cfa
+// implementation of arguments parsing (argc, argv)
+//
+// Author           : Thierry Delisle
+// Created On       : Wed Oct 12 15:28:01 2022
+// Last Modified By :
+// Last Modified On :
+// Update Count     :
+//
+
 #include "parseargs.hfa"
 
+#include <assert.h>
 #include <ctype.h>
 #include <stdint.h>
@@ -146,23 +163,60 @@
 }
 
+static inline int next_newline(const char * str) {
+	int ret;
+	const char * ptr = strstr(str, "\n");
+	if(!ptr) return MAX;
+
+	/* paranoid */ verify( str <= ptr);
+	intptr_t low = (intptr_t)str;
+	intptr_t hi  = (intptr_t)ptr;
+	ret = hi - low;
+
+	return ret;
+}
+
 //-----------------------------------------------------------------------------
 // Print usage
 static void printopt(FILE * out, int width, int max, char sn, const char * ln, const char * help) {
+	// check how wide we should be printing
+	// this includes all options and the help message
 	int hwidth = max - (11 + width);
 	if(hwidth <= 0) hwidth = max;
 
-	char sname[4] = { ' ', ' ', ' ', '\0' };
-	if(sn != '\0') {
-		sname[0] = '-';
-		sname[1] = sn;
-		sname[2] = ',';
-	}
-
-	fprintf(out, "  %s --%-*s   %.*s\n", sname, width, ln, hwidth, help);
-	for() {
-		help += min(strlen(help), hwidth);
-		if('\0' == *help) break;
-		fprintf(out, "%*s%.*s\n", width + 11, "", hwidth, help);
-	}
+	// check which pieces we have
+	bool has_ln = ln && strcmp("", ln);
+	bool has_help = help && strcmp("", help);
+
+	// print the small name if present
+	if(sn != '\0') fprintf(out, "  -%c", sn);
+	else fprintf(out, "    ");
+
+	// print a comma if we have both short and long names
+	if(sn != '\0' && has_ln) fprintf(out, ", ");
+	else fprintf(out, "  ");
+
+	// print the long name if present
+	if(has_ln)        fprintf(out, "--%-*s", width, ln);
+	else if(has_help) fprintf(out, "  %-*s", width, "");
+
+	if(has_help) {
+		// print the help
+		// We need to wrap at the max width, and also indent newlines so everything is nice and pretty
+
+		// for each line to print
+		for() {
+			//find out if there is a newline
+			int nextnl = next_newline(help);
+			int real = min(min(strlen(help), hwidth), nextnl);
+
+			fprintf(out, "   %.*s", real, help);
+			// printf("%d %d\n", real, nextnl);
+			help += real;
+			if( nextnl == real ) help++;
+			if('\0' == *help) break;
+			fprintf(out, "\n%*s", width + 8, "");
+		}
+	}
+	fprintf(out, "\n");
 }
 
Index: libcfa/src/parseargs.hfa
===================================================================
--- libcfa/src/parseargs.hfa	(revision a25bcf8ab29dde92e982540e533dcee4c347fd63)
+++ libcfa/src/parseargs.hfa	(revision 4af5396caad4605b138ead74b53857a746688724)
@@ -1,2 +1,17 @@
+//
+// Cforall Version 1.0.0 Copyright (C) 2022 University of Waterloo
+//
+// The contents of this file are covered under the licence agreement in the
+// file "LICENCE" distributed with Cforall.
+//
+// parseargs.cfa -- PUBLIC
+// API for arguments parsing (argc, argv)
+//
+// Author           : Thierry Delisle
+// Created On       : Wed Oct 12 15:28:01 2022
+// Last Modified By :
+// Last Modified On :
+// Update Count     :
+//
 #pragma once
 
Index: tests/configs/.expect/parsebools.txt
===================================================================
--- tests/configs/.expect/parsebools.txt	(revision a25bcf8ab29dde92e982540e533dcee4c347fd63)
+++ tests/configs/.expect/parsebools.txt	(revision 4af5396caad4605b138ead74b53857a746688724)
@@ -7,5 +7,5 @@
 set false  :true
 Child status:
-    WIFEXITED   : 1    WEXITSTATUS : 0    WIFSIGNALED : 0    WTERMSIG    : 0    WCOREDUMP   : 0    WIFSTOPPED  : 0    WSTOPSIG    : 0    WIFCONTINUED: 0
+IFEXITED   : 1, EXITSTATUS : 0, IFSIGNALED : 0, TERMSIG    : 0, COREDUMP   : 0, IFSTOPPED  : 0, STOPSIG    : 0, IFCONTINUED: 0
 
 all true/set arg:
@@ -17,5 +17,5 @@
 set false  :false
 Child status:
-    WIFEXITED   : 1    WEXITSTATUS : 0    WIFSIGNALED : 0    WTERMSIG    : 0    WCOREDUMP   : 0    WIFSTOPPED  : 0    WSTOPSIG    : 0    WIFCONTINUED: 0
+IFEXITED   : 1, EXITSTATUS : 0, IFSIGNALED : 0, TERMSIG    : 0, COREDUMP   : 0, IFSTOPPED  : 0, STOPSIG    : 0, IFCONTINUED: 0
 
 all false/unset arg:
@@ -27,5 +27,5 @@
 set false  :true
 Child status:
-    WIFEXITED   : 1    WEXITSTATUS : 0    WIFSIGNALED : 0    WTERMSIG    : 0    WCOREDUMP   : 0    WIFSTOPPED  : 0    WSTOPSIG    : 0    WIFCONTINUED: 0
+IFEXITED   : 1, EXITSTATUS : 0, IFSIGNALED : 0, TERMSIG    : 0, COREDUMP   : 0, IFSTOPPED  : 0, STOPSIG    : 0, IFCONTINUED: 0
 
 gibberish arg 1:
@@ -43,5 +43,5 @@
   -h, --help        print this help message
 Child status:
-    WIFEXITED   : 1    WEXITSTATUS : 1    WIFSIGNALED : 0    WTERMSIG    : 0    WCOREDUMP   : 0    WIFSTOPPED  : 0    WSTOPSIG    : 1    WIFCONTINUED: 0
+IFEXITED   : 1, EXITSTATUS : 1, IFSIGNALED : 0, TERMSIG    : 0, COREDUMP   : 0, IFSTOPPED  : 0, STOPSIG    : 1, IFCONTINUED: 0
 
 gibberish arg 2:
@@ -59,5 +59,5 @@
   -h, --help        print this help message
 Child status:
-    WIFEXITED   : 1    WEXITSTATUS : 1    WIFSIGNALED : 0    WTERMSIG    : 0    WCOREDUMP   : 0    WIFSTOPPED  : 0    WSTOPSIG    : 1    WIFCONTINUED: 0
+IFEXITED   : 1, EXITSTATUS : 1, IFSIGNALED : 0, TERMSIG    : 0, COREDUMP   : 0, IFSTOPPED  : 0, STOPSIG    : 1, IFCONTINUED: 0
 
 gibberish arg 3:
@@ -74,5 +74,5 @@
   -h, --help        print this help message
 Child status:
-    WIFEXITED   : 1    WEXITSTATUS : 1    WIFSIGNALED : 0    WTERMSIG    : 0    WCOREDUMP   : 0    WIFSTOPPED  : 0    WSTOPSIG    : 1    WIFCONTINUED: 0
+IFEXITED   : 1, EXITSTATUS : 1, IFSIGNALED : 0, TERMSIG    : 0, COREDUMP   : 0, IFSTOPPED  : 0, STOPSIG    : 1, IFCONTINUED: 0
 
 gibberish arg 4:
@@ -89,5 +89,5 @@
   -h, --help        print this help message
 Child status:
-    WIFEXITED   : 1    WEXITSTATUS : 1    WIFSIGNALED : 0    WTERMSIG    : 0    WCOREDUMP   : 0    WIFSTOPPED  : 0    WSTOPSIG    : 1    WIFCONTINUED: 0
+IFEXITED   : 1, EXITSTATUS : 1, IFSIGNALED : 0, TERMSIG    : 0, COREDUMP   : 0, IFSTOPPED  : 0, STOPSIG    : 1, IFCONTINUED: 0
 
 All Done!
Index: tests/configs/.expect/parsenums.x64.txt
===================================================================
--- tests/configs/.expect/parsenums.x64.txt	(revision a25bcf8ab29dde92e982540e533dcee4c347fd63)
+++ tests/configs/.expect/parsenums.x64.txt	(revision 4af5396caad4605b138ead74b53857a746688724)
@@ -6,5 +6,5 @@
 double             :3.3
 Child status:
-    WIFEXITED   : 1    WEXITSTATUS : 0    WIFSIGNALED : 0    WTERMSIG    : 0    WCOREDUMP   : 0    WIFSTOPPED  : 0    WSTOPSIG    : 0    WIFCONTINUED: 0
+IFEXITED   : 1, EXITSTATUS : 0, IFSIGNALED : 0, TERMSIG    : 0, COREDUMP   : 0, IFSTOPPED  : 0, STOPSIG    : 0, IFCONTINUED: 0
 
 all 0 arg:
@@ -15,5 +15,5 @@
 double             :0.
 Child status:
-    WIFEXITED   : 1    WEXITSTATUS : 0    WIFSIGNALED : 0    WTERMSIG    : 0    WCOREDUMP   : 0    WIFSTOPPED  : 0    WSTOPSIG    : 0    WIFCONTINUED: 0
+IFEXITED   : 1, EXITSTATUS : 0, IFSIGNALED : 0, TERMSIG    : 0, COREDUMP   : 0, IFSTOPPED  : 0, STOPSIG    : 0, IFCONTINUED: 0
 
 negative vals arg:
@@ -24,5 +24,5 @@
 double             :-1.
 Child status:
-    WIFEXITED   : 1    WEXITSTATUS : 0    WIFSIGNALED : 0    WTERMSIG    : 0    WCOREDUMP   : 0    WIFSTOPPED  : 0    WSTOPSIG    : 0    WIFCONTINUED: 0
+IFEXITED   : 1, EXITSTATUS : 0, IFSIGNALED : 0, TERMSIG    : 0, COREDUMP   : 0, IFSTOPPED  : 0, STOPSIG    : 0, IFCONTINUED: 0
 
 funky notation arg:
@@ -33,5 +33,5 @@
 double             :5000000.
 Child status:
-    WIFEXITED   : 1    WEXITSTATUS : 0    WIFSIGNALED : 0    WTERMSIG    : 0    WCOREDUMP   : 0    WIFSTOPPED  : 0    WSTOPSIG    : 0    WIFCONTINUED: 0
+IFEXITED   : 1, EXITSTATUS : 0, IFSIGNALED : 0, TERMSIG    : 0, COREDUMP   : 0, IFSTOPPED  : 0, STOPSIG    : 0, IFCONTINUED: 0
 
 big values arg:
@@ -42,5 +42,5 @@
 double             :5000000.
 Child status:
-    WIFEXITED   : 1    WEXITSTATUS : 0    WIFSIGNALED : 0    WTERMSIG    : 0    WCOREDUMP   : 0    WIFSTOPPED  : 0    WSTOPSIG    : 0    WIFCONTINUED: 0
+IFEXITED   : 1, EXITSTATUS : 0, IFSIGNALED : 0, TERMSIG    : 0, COREDUMP   : 0, IFSTOPPED  : 0, STOPSIG    : 0, IFCONTINUED: 0
 
 too big values arg:
@@ -57,5 +57,5 @@
   -h, --help               print this help message
 Child status:
-    WIFEXITED   : 1    WEXITSTATUS : 1    WIFSIGNALED : 0    WTERMSIG    : 0    WCOREDUMP   : 0    WIFSTOPPED  : 0    WSTOPSIG    : 1    WIFCONTINUED: 0
+IFEXITED   : 1, EXITSTATUS : 1, IFSIGNALED : 0, TERMSIG    : 0, COREDUMP   : 0, IFSTOPPED  : 0, STOPSIG    : 1, IFCONTINUED: 0
 
 Argument '4294967296' for option u could not be parsed
@@ -71,5 +71,5 @@
   -h, --help               print this help message
 Child status:
-    WIFEXITED   : 1    WEXITSTATUS : 1    WIFSIGNALED : 0    WTERMSIG    : 0    WCOREDUMP   : 0    WIFSTOPPED  : 0    WSTOPSIG    : 1    WIFCONTINUED: 0
+IFEXITED   : 1, EXITSTATUS : 1, IFSIGNALED : 0, TERMSIG    : 0, COREDUMP   : 0, IFSTOPPED  : 0, STOPSIG    : 1, IFCONTINUED: 0
 
 Argument '18446744073709551616' for option l could not be parsed
@@ -85,5 +85,5 @@
   -h, --help               print this help message
 Child status:
-    WIFEXITED   : 1    WEXITSTATUS : 1    WIFSIGNALED : 0    WTERMSIG    : 0    WCOREDUMP   : 0    WIFSTOPPED  : 0    WSTOPSIG    : 1    WIFCONTINUED: 0
+IFEXITED   : 1, EXITSTATUS : 1, IFSIGNALED : 0, TERMSIG    : 0, COREDUMP   : 0, IFSTOPPED  : 0, STOPSIG    : 1, IFCONTINUED: 0
 
 Argument '18446744073709551616' for option L could not be parsed
@@ -99,5 +99,5 @@
   -h, --help               print this help message
 Child status:
-    WIFEXITED   : 1    WEXITSTATUS : 1    WIFSIGNALED : 0    WTERMSIG    : 0    WCOREDUMP   : 0    WIFSTOPPED  : 0    WSTOPSIG    : 1    WIFCONTINUED: 0
+IFEXITED   : 1, EXITSTATUS : 1, IFSIGNALED : 0, TERMSIG    : 0, COREDUMP   : 0, IFSTOPPED  : 0, STOPSIG    : 1, IFCONTINUED: 0
 
 negative errors arg:
@@ -114,5 +114,5 @@
   -h, --help               print this help message
 Child status:
-    WIFEXITED   : 1    WEXITSTATUS : 1    WIFSIGNALED : 0    WTERMSIG    : 0    WCOREDUMP   : 0    WIFSTOPPED  : 0    WSTOPSIG    : 1    WIFCONTINUED: 0
+IFEXITED   : 1, EXITSTATUS : 1, IFSIGNALED : 0, TERMSIG    : 0, COREDUMP   : 0, IFSTOPPED  : 0, STOPSIG    : 1, IFCONTINUED: 0
 
 Argument '-1' for option l could not be parsed
@@ -128,5 +128,5 @@
   -h, --help               print this help message
 Child status:
-    WIFEXITED   : 1    WEXITSTATUS : 1    WIFSIGNALED : 0    WTERMSIG    : 0    WCOREDUMP   : 0    WIFSTOPPED  : 0    WSTOPSIG    : 1    WIFCONTINUED: 0
+IFEXITED   : 1, EXITSTATUS : 1, IFSIGNALED : 0, TERMSIG    : 0, COREDUMP   : 0, IFSTOPPED  : 0, STOPSIG    : 1, IFCONTINUED: 0
 
 Argument '-1' for option L could not be parsed
@@ -142,5 +142,5 @@
   -h, --help               print this help message
 Child status:
-    WIFEXITED   : 1    WEXITSTATUS : 1    WIFSIGNALED : 0    WTERMSIG    : 0    WCOREDUMP   : 0    WIFSTOPPED  : 0    WSTOPSIG    : 1    WIFCONTINUED: 0
+IFEXITED   : 1, EXITSTATUS : 1, IFSIGNALED : 0, TERMSIG    : 0, COREDUMP   : 0, IFSTOPPED  : 0, STOPSIG    : 1, IFCONTINUED: 0
 
 All Done!
Index: tests/configs/.expect/parsenums.x86.txt
===================================================================
--- tests/configs/.expect/parsenums.x86.txt	(revision a25bcf8ab29dde92e982540e533dcee4c347fd63)
+++ tests/configs/.expect/parsenums.x86.txt	(revision 4af5396caad4605b138ead74b53857a746688724)
@@ -6,5 +6,5 @@
 double             :3.3
 Child status:
-    WIFEXITED   : 1    WEXITSTATUS : 0    WIFSIGNALED : 0    WTERMSIG    : 0    WCOREDUMP   : 0    WIFSTOPPED  : 0    WSTOPSIG    : 0    WIFCONTINUED: 0
+IFEXITED   : 1, EXITSTATUS : 0, IFSIGNALED : 0, TERMSIG    : 0, COREDUMP   : 0, IFSTOPPED  : 0, STOPSIG    : 0, IFCONTINUED: 0
 
 all 0 arg:
@@ -15,5 +15,5 @@
 double             :0.
 Child status:
-    WIFEXITED   : 1    WEXITSTATUS : 0    WIFSIGNALED : 0    WTERMSIG    : 0    WCOREDUMP   : 0    WIFSTOPPED  : 0    WSTOPSIG    : 0    WIFCONTINUED: 0
+IFEXITED   : 1, EXITSTATUS : 0, IFSIGNALED : 0, TERMSIG    : 0, COREDUMP   : 0, IFSTOPPED  : 0, STOPSIG    : 0, IFCONTINUED: 0
 
 negative vals arg:
@@ -24,5 +24,5 @@
 double             :-1.
 Child status:
-    WIFEXITED   : 1    WEXITSTATUS : 0    WIFSIGNALED : 0    WTERMSIG    : 0    WCOREDUMP   : 0    WIFSTOPPED  : 0    WSTOPSIG    : 0    WIFCONTINUED: 0
+IFEXITED   : 1, EXITSTATUS : 0, IFSIGNALED : 0, TERMSIG    : 0, COREDUMP   : 0, IFSTOPPED  : 0, STOPSIG    : 0, IFCONTINUED: 0
 
 funky notation arg:
@@ -33,5 +33,5 @@
 double             :5000000.
 Child status:
-    WIFEXITED   : 1    WEXITSTATUS : 0    WIFSIGNALED : 0    WTERMSIG    : 0    WCOREDUMP   : 0    WIFSTOPPED  : 0    WSTOPSIG    : 0    WIFCONTINUED: 0
+IFEXITED   : 1, EXITSTATUS : 0, IFSIGNALED : 0, TERMSIG    : 0, COREDUMP   : 0, IFSTOPPED  : 0, STOPSIG    : 0, IFCONTINUED: 0
 
 big values arg:
@@ -42,5 +42,5 @@
 double             :5000000.
 Child status:
-    WIFEXITED   : 1    WEXITSTATUS : 0    WIFSIGNALED : 0    WTERMSIG    : 0    WCOREDUMP   : 0    WIFSTOPPED  : 0    WSTOPSIG    : 0    WIFCONTINUED: 0
+IFEXITED   : 1, EXITSTATUS : 0, IFSIGNALED : 0, TERMSIG    : 0, COREDUMP   : 0, IFSTOPPED  : 0, STOPSIG    : 0, IFCONTINUED: 0
 
 too big values arg:
@@ -57,5 +57,5 @@
   -h, --help               print this help message
 Child status:
-    WIFEXITED   : 1    WEXITSTATUS : 1    WIFSIGNALED : 0    WTERMSIG    : 0    WCOREDUMP   : 0    WIFSTOPPED  : 0    WSTOPSIG    : 1    WIFCONTINUED: 0
+IFEXITED   : 1, EXITSTATUS : 1, IFSIGNALED : 0, TERMSIG    : 0, COREDUMP   : 0, IFSTOPPED  : 0, STOPSIG    : 1, IFCONTINUED: 0
 
 Argument '4294967296' for option u could not be parsed
@@ -71,5 +71,5 @@
   -h, --help               print this help message
 Child status:
-    WIFEXITED   : 1    WEXITSTATUS : 1    WIFSIGNALED : 0    WTERMSIG    : 0    WCOREDUMP   : 0    WIFSTOPPED  : 0    WSTOPSIG    : 1    WIFCONTINUED: 0
+IFEXITED   : 1, EXITSTATUS : 1, IFSIGNALED : 0, TERMSIG    : 0, COREDUMP   : 0, IFSTOPPED  : 0, STOPSIG    : 1, IFCONTINUED: 0
 
 Argument '4294967296' for option l could not be parsed
@@ -85,5 +85,5 @@
   -h, --help               print this help message
 Child status:
-    WIFEXITED   : 1    WEXITSTATUS : 1    WIFSIGNALED : 0    WTERMSIG    : 0    WCOREDUMP   : 0    WIFSTOPPED  : 0    WSTOPSIG    : 1    WIFCONTINUED: 0
+IFEXITED   : 1, EXITSTATUS : 1, IFSIGNALED : 0, TERMSIG    : 0, COREDUMP   : 0, IFSTOPPED  : 0, STOPSIG    : 1, IFCONTINUED: 0
 
 Argument '18446744073709551616' for option L could not be parsed
@@ -99,5 +99,5 @@
   -h, --help               print this help message
 Child status:
-    WIFEXITED   : 1    WEXITSTATUS : 1    WIFSIGNALED : 0    WTERMSIG    : 0    WCOREDUMP   : 0    WIFSTOPPED  : 0    WSTOPSIG    : 1    WIFCONTINUED: 0
+IFEXITED   : 1, EXITSTATUS : 1, IFSIGNALED : 0, TERMSIG    : 0, COREDUMP   : 0, IFSTOPPED  : 0, STOPSIG    : 1, IFCONTINUED: 0
 
 negative errors arg:
@@ -114,5 +114,5 @@
   -h, --help               print this help message
 Child status:
-    WIFEXITED   : 1    WEXITSTATUS : 1    WIFSIGNALED : 0    WTERMSIG    : 0    WCOREDUMP   : 0    WIFSTOPPED  : 0    WSTOPSIG    : 1    WIFCONTINUED: 0
+IFEXITED   : 1, EXITSTATUS : 1, IFSIGNALED : 0, TERMSIG    : 0, COREDUMP   : 0, IFSTOPPED  : 0, STOPSIG    : 1, IFCONTINUED: 0
 
 Argument '-1' for option l could not be parsed
@@ -128,5 +128,5 @@
   -h, --help               print this help message
 Child status:
-    WIFEXITED   : 1    WEXITSTATUS : 1    WIFSIGNALED : 0    WTERMSIG    : 0    WCOREDUMP   : 0    WIFSTOPPED  : 0    WSTOPSIG    : 1    WIFCONTINUED: 0
+IFEXITED   : 1, EXITSTATUS : 1, IFSIGNALED : 0, TERMSIG    : 0, COREDUMP   : 0, IFSTOPPED  : 0, STOPSIG    : 1, IFCONTINUED: 0
 
 Argument '-1' for option L could not be parsed
@@ -142,5 +142,5 @@
   -h, --help               print this help message
 Child status:
-    WIFEXITED   : 1    WEXITSTATUS : 1    WIFSIGNALED : 0    WTERMSIG    : 0    WCOREDUMP   : 0    WIFSTOPPED  : 0    WSTOPSIG    : 1    WIFCONTINUED: 0
+IFEXITED   : 1, EXITSTATUS : 1, IFSIGNALED : 0, TERMSIG    : 0, COREDUMP   : 0, IFSTOPPED  : 0, STOPSIG    : 1, IFCONTINUED: 0
 
 All Done!
Index: tests/configs/.expect/usage.txt
===================================================================
--- tests/configs/.expect/usage.txt	(revision 4af5396caad4605b138ead74b53857a746688724)
+++ tests/configs/.expect/usage.txt	(revision 4af5396caad4605b138ead74b53857a746688724)
@@ -0,0 +1,66 @@
+No args, no errors
+Usage:
+  ./usage Test usage
+  -h, --help   print this help message
+Child status:
+IFEXITED   : 1, EXITSTATUS : 0, IFSIGNALED : 0, TERMSIG    : 0, COREDUMP   : 0, IFSTOPPED  : 0, STOPSIG    : 0, IFCONTINUED: 0
+
+No args, with errors
+Usage:
+  ./usage Test usage
+  -h, --help   print this help message
+Child status:
+IFEXITED   : 1, EXITSTATUS : 1, IFSIGNALED : 0, TERMSIG    : 0, COREDUMP   : 0, IFSTOPPED  : 0, STOPSIG    : 1, IFCONTINUED: 0
+
+Args with short names only:
+Usage:
+  ./usage Test usage
+  -a       First arg
+  -b       Second arg
+  -c       Third arg
+  -h, --help   print this help message
+Child status:
+IFEXITED   : 1, EXITSTATUS : 0, IFSIGNALED : 0, TERMSIG    : 0, COREDUMP   : 0, IFSTOPPED  : 0, STOPSIG    : 0, IFCONTINUED: 0
+
+Args with long names only:
+Usage:
+  ./usage Test usage
+      --AA   First arg
+      --BB   Second arg
+      --CC   Third arg
+  -h, --help   print this help message
+Child status:
+IFEXITED   : 1, EXITSTATUS : 0, IFSIGNALED : 0, TERMSIG    : 0, COREDUMP   : 0, IFSTOPPED  : 0, STOPSIG    : 0, IFCONTINUED: 0
+
+Mix of short and long args:
+Usage:
+  ./usage Test usage
+  -a           First arg
+  -b, --BBBB   Second arg
+      --CC     Third arg
+  -h, --help   print this help message
+Child status:
+IFEXITED   : 1, EXITSTATUS : 0, IFSIGNALED : 0, TERMSIG    : 0, COREDUMP   : 0, IFSTOPPED  : 0, STOPSIG    : 0, IFCONTINUED: 0
+
+Mix of short and long and some missing description:
+Usage:
+  ./usage Test usage
+  -a           First arg
+  -b, --BBBB
+      --CC     Third arg
+  -h, --help   print this help message
+Child status:
+IFEXITED   : 1, EXITSTATUS : 0, IFSIGNALED : 0, TERMSIG    : 0, COREDUMP   : 0, IFSTOPPED  : 0, STOPSIG    : 0, IFCONTINUED: 0
+
+Mix of short and long and some long description:
+Usage:
+  ./usage Test usage
+  -a           First arg
+               The description has multiple lines,
+               ...for some reason
+  -b, --BBBB   12345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890
+      --CC     Third arg
+  -h, --help   print this help message
+Child status:
+IFEXITED   : 1, EXITSTATUS : 0, IFSIGNALED : 0, TERMSIG    : 0, COREDUMP   : 0, IFSTOPPED  : 0, STOPSIG    : 0, IFCONTINUED: 0
+
Index: tests/configs/parsebools.cfa
===================================================================
--- tests/configs/parsebools.cfa	(revision a25bcf8ab29dde92e982540e533dcee4c347fd63)
+++ tests/configs/parsebools.cfa	(revision 4af5396caad4605b138ead74b53857a746688724)
@@ -1,22 +1,25 @@
-#include <stdlib.h>
-#include <stdio.h>
-#include <string.h>
-
-#include <errno.h>
-#include <signal.h>
-
-extern "C" {
-	#include <sys/types.h>
-	#include <sys/wait.h>
-	#include <unistd.h>
-}
+//
+// Cforall Version 1.0.0 Copyright (C) 2022 University of Waterloo
+//
+// The contents of this file are covered under the licence agreement in the
+// file "LICENCE" distributed with Cforall.
+//
+// configs/parsebools.cfa
+// Testing parsing of boolean arguments
+//
+// Author           : Thierry Delisle
+// Created On       : Wed Oct 12 15:28:01 2022
+// Last Modified By :
+// Last Modified On :
+// Update Count     :
+//
 
 #include <parseargs.hfa>
 #include <fstream.hfa>
 
-int true_main(const char * exec);
+#include "../meta/fork+exec.hfa"
 
 int main(int argc, char * argv[]) {
-	if(!getenv("CFATEST_FORK_EXEC_TEXT")) return true_main(argv[0]);
+	check_main(argv[0]);
 
 	bool YN = false;
@@ -48,41 +51,5 @@
 }
 
-int do_wait(pid_t pid) {
-	int wstatus;
-	int options = 0;
-	pid_t ret = waitpid(pid, &wstatus, options);
-	fflush(stdout);
-	if(ret < 0) {
-		fprintf(stderr, "Fork returned with error: %d '%s'\n", errno, strerror(errno));
-		exit(1);
-	}
-	return wstatus;
-}
-
-pid_t strict_fork(void) {
-	fflush(stdout);
-	pid_t ret = fork();
-	if(ret < 0) {
-		fprintf(stderr, "Fork returned with error: %d '%s'\n", errno, strerror(errno));
-		exit(1);
-	}
-	return ret;
-}
-
-void print_status(int wstatus) {
-	printf("Child status:\n");
-	printf("    WIFEXITED   : %d", WIFEXITED(wstatus));
-	printf("    WEXITSTATUS : %d", WEXITSTATUS(wstatus));
-	printf("    WIFSIGNALED : %d", WIFSIGNALED(wstatus));
-	printf("    WTERMSIG    : %d", WTERMSIG(wstatus));
-	printf("    WCOREDUMP   : %d", WCOREDUMP(wstatus));
-	printf("    WIFSTOPPED  : %d", WIFSTOPPED(wstatus));
-	printf("    WSTOPSIG    : %d", WSTOPSIG(wstatus));
-	printf("    WIFCONTINUED: %d\n", WIFCONTINUED(wstatus));
-}
-
-int true_main(const char * path) {
-	char * env[] = { "CFATEST_FORK_EXEC_TEXT=1", 0p };
-
+int true_main(const char * path, char * env[]) {
 	printf("no arg:\n");
 	if(pid_t child = strict_fork(); child == 0) {
@@ -97,5 +64,4 @@
 		print_status(status);
 	}
-	printf("\n");
 
 	printf("all true/set arg:\n");
@@ -111,5 +77,4 @@
 		print_status(status);
 	}
-	printf("\n");
 
 	printf("all false/unset arg:\n");
@@ -125,5 +90,4 @@
 		print_status(status);
 	}
-	printf("\n");
 
 	printf("gibberish arg 1:\n");
@@ -139,5 +103,4 @@
 		print_status(status);
 	}
-	printf("\n");
 
 	printf("gibberish arg 2:\n");
@@ -153,5 +116,4 @@
 		print_status(status);
 	}
-	printf("\n");
 
 	printf("gibberish arg 3:\n");
@@ -167,5 +129,4 @@
 		print_status(status);
 	}
-	printf("\n");
 
 	printf("gibberish arg 4:\n");
@@ -181,5 +142,4 @@
 		print_status(status);
 	}
-	printf("\n");
 
 	printf("All Done!\n");
Index: tests/configs/parsenums.cfa
===================================================================
--- tests/configs/parsenums.cfa	(revision a25bcf8ab29dde92e982540e533dcee4c347fd63)
+++ tests/configs/parsenums.cfa	(revision 4af5396caad4605b138ead74b53857a746688724)
@@ -1,17 +1,22 @@
-#include <stdlib.h>
-#include <stdio.h>
-#include <string.h>
-
-#include <errno.h>
-#include <signal.h>
-
-extern "C" {
-	#include <sys/types.h>
-	#include <sys/wait.h>
-	#include <unistd.h>
-}
+//
+// Cforall Version 1.0.0 Copyright (C) 2022 University of Waterloo
+//
+// The contents of this file are covered under the licence agreement in the
+// file "LICENCE" distributed with Cforall.
+//
+// configs/parsenums.cfa
+// Testing parsing of integer arguments
+//
+// Author           : Thierry Delisle
+// Created On       : Wed Oct 12 15:28:01 2022
+// Last Modified By :
+// Last Modified On :
+// Update Count     :
+//
 
 #include <parseargs.hfa>
 #include <fstream.hfa>
+
+#include "../meta/fork+exec.hfa"
 
 #if __SIZEOF_LONG__ == 4
@@ -28,5 +33,5 @@
 
 int main(int argc, char * argv[]) {
-	if(!getenv("CFATEST_FORK_EXEC_TEXT")) return true_main(argv[0]);
+	check_main(argv[0]);
 
 	int i = -3;
@@ -56,41 +61,5 @@
 }
 
-int do_wait(pid_t pid) {
-	int wstatus;
-	int options = 0;
-	pid_t ret = waitpid(pid, &wstatus, options);
-	fflush(stdout);
-	if(ret < 0) {
-		fprintf(stderr, "Fork returned with error: %d '%s'\n", errno, strerror(errno));
-		exit(1);
-	}
-	return wstatus;
-}
-
-pid_t strict_fork(void) {
-	fflush(stdout);
-	pid_t ret = fork();
-	if(ret < 0) {
-		fprintf(stderr, "Fork returned with error: %d '%s'\n", errno, strerror(errno));
-		exit(1);
-	}
-	return ret;
-}
-
-void print_status(int wstatus) {
-	printf("Child status:\n");
-	printf("    WIFEXITED   : %d", WIFEXITED(wstatus));
-	printf("    WEXITSTATUS : %d", WEXITSTATUS(wstatus));
-	printf("    WIFSIGNALED : %d", WIFSIGNALED(wstatus));
-	printf("    WTERMSIG    : %d", WTERMSIG(wstatus));
-	printf("    WCOREDUMP   : %d", WCOREDUMP(wstatus));
-	printf("    WIFSTOPPED  : %d", WIFSTOPPED(wstatus));
-	printf("    WSTOPSIG    : %d", WSTOPSIG(wstatus));
-	printf("    WIFCONTINUED: %d\n", WIFCONTINUED(wstatus));
-}
-
-int true_main(const char * path) {
-	char * env[] = { "CFATEST_FORK_EXEC_TEXT=1", 0p };
-
+int true_main(const char * path, char * env[]) {
 	printf("no arg:\n");
 	if(pid_t child = strict_fork(); child == 0) {
@@ -105,5 +74,4 @@
 		print_status(status);
 	}
-	printf("\n");
 
 	printf("all 0 arg:\n");
@@ -119,5 +87,4 @@
 		print_status(status);
 	}
-	printf("\n");
 
 	printf("negative vals arg:\n");
@@ -133,5 +100,4 @@
 		print_status(status);
 	}
-	printf("\n");
 
 	printf("funky notation arg:\n");
@@ -147,5 +113,4 @@
 		print_status(status);
 	}
-	printf("\n");
 
 	printf("big values arg:\n");
@@ -161,5 +126,4 @@
 		print_status(status);
 	}
-	printf("\n");
 
 	printf("too big values arg:\n");
@@ -175,5 +139,4 @@
 		print_status(status);
 	}
-	printf("\n");
 
 	if(pid_t child = strict_fork(); child == 0) {
@@ -188,5 +151,4 @@
 		print_status(status);
 	}
-	printf("\n");
 
 	if(pid_t child = strict_fork(); child == 0) {
@@ -201,5 +163,4 @@
 		print_status(status);
 	}
-	printf("\n");
 
 	if(pid_t child = strict_fork(); child == 0) {
@@ -214,5 +175,4 @@
 		print_status(status);
 	}
-	printf("\n");
 
 	printf("negative errors arg:\n");
@@ -228,5 +188,4 @@
 		print_status(status);
 	}
-	printf("\n");
 
 	if(pid_t child = strict_fork(); child == 0) {
@@ -241,5 +200,4 @@
 		print_status(status);
 	}
-	printf("\n");
 
 	if(pid_t child = strict_fork(); child == 0) {
@@ -254,5 +212,4 @@
 		print_status(status);
 	}
-	printf("\n");
 
 	printf("All Done!\n");
Index: tests/configs/usage.cfa
===================================================================
--- tests/configs/usage.cfa	(revision 4af5396caad4605b138ead74b53857a746688724)
+++ tests/configs/usage.cfa	(revision 4af5396caad4605b138ead74b53857a746688724)
@@ -0,0 +1,122 @@
+//
+// Cforall Version 1.0.0 Copyright (C) 2022 University of Waterloo
+//
+// The contents of this file are covered under the licence agreement in the
+// file "LICENCE" distributed with Cforall.
+//
+// configs/usage.cfa
+// Testing printing of usage for arguments
+//
+// Author           : Thierry Delisle
+// Created On       : Wed Oct 12 15:28:01 2022
+// Last Modified By :
+// Last Modified On :
+// Update Count     :
+//
+
+#include <parseargs.hfa>
+#include <fstream.hfa>
+
+#include "../meta/fork+exec.hfa"
+
+int main() {
+	char * fake_argv[] = { "./usage" };
+
+	sout | "No args, no errors";
+	if(pid_t child = strict_fork(); child == 0) {
+		cfa_option opts[0];
+		print_args_usage(1, fake_argv, opts, 0, "Test usage", false);
+	}
+	else {
+		int status = do_wait(child);
+		print_status(status);
+	}
+
+	sout | "No args, with errors";
+	if(pid_t child = strict_fork(); child == 0) {
+		cfa_option opts[0];
+		print_args_usage(1, fake_argv, opts, 0, "Test usage", true);
+	}
+	else {
+		int status = do_wait(child);
+		print_status(status);
+	}
+
+	sout | "Args with short names only:";
+	if(pid_t child = strict_fork(); child == 0) {
+		int a, b, c;
+		cfa_option opts[] = {
+			{'a', "", "First arg", a },
+			{'b', "", "Second arg", b },
+			{'c', "", "Third arg", c },
+		};
+		print_args_usage(1, fake_argv, opts, 3, "Test usage", false);
+	}
+	else {
+		int status = do_wait(child);
+		print_status(status);
+	}
+
+	sout | "Args with long names only:";
+	if(pid_t child = strict_fork(); child == 0) {
+		int a, b, c;
+		cfa_option opts[] = {
+			{'\0', "AA", "First arg", a },
+			{'\0', "BB", "Second arg", b },
+			{'\0', "CC", "Third arg", c },
+		};
+		print_args_usage(1, fake_argv, opts, 3, "Test usage", false);
+	}
+	else {
+		int status = do_wait(child);
+		print_status(status);
+	}
+
+	sout | "Mix of short and long args:";
+	if(pid_t child = strict_fork(); child == 0) {
+		int a, b, c;
+		cfa_option opts[] = {
+			{'a', "", "First arg", a },
+			{'b', "BBBB", "Second arg", b },
+			{'\0', "CC", "Third arg", c },
+		};
+		print_args_usage(1, fake_argv, opts, 3, "Test usage", false);
+	}
+	else {
+		int status = do_wait(child);
+		print_status(status);
+	}
+
+	sout | "Mix of short and long and some missing description:";
+	if(pid_t child = strict_fork(); child == 0) {
+		int a, b, c;
+		cfa_option opts[] = {
+			{'a', "", "First arg", a },
+			{'b', "BBBB", "", b },
+			{'\0', "CC", "Third arg", c },
+		};
+		print_args_usage(1, fake_argv, opts, 3, "Test usage", false);
+	}
+	else {
+		int status = do_wait(child);
+		print_status(status);
+	}
+
+	sout | "Mix of short and long and some long description:";
+	if(pid_t child = strict_fork(); child == 0) {
+		int a, b, c;
+		cfa_option opts[] = {
+			{'a', "", "First arg\nThe description has multiple lines,\n...for some reason", a },
+			{'b', "BBBB", "12345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890", b },
+			{'\0', "CC", "Third arg", c },
+		};
+		print_args_usage(1, fake_argv, opts, 3, "Test usage", false);
+	}
+	else {
+		int status = do_wait(child);
+		print_status(status);
+	}
+}
+
+// no used
+static int true_main(const char * path, char * env[]) { return 0; }
Index: tests/meta/.expect/fork+exec.txt
===================================================================
--- tests/meta/.expect/fork+exec.txt	(revision a25bcf8ab29dde92e982540e533dcee4c347fd63)
+++ tests/meta/.expect/fork+exec.txt	(revision 4af5396caad4605b138ead74b53857a746688724)
@@ -4,12 +4,6 @@
 Success!
 Child status:
-    WIFEXITED   : 1
-    WEXITSTATUS : 0
-    WIFSIGNALED : 0
-    WTERMSIG    : 0
-    WCOREDUMP   : 0
-    WIFSTOPPED  : 0
-    WSTOPSIG    : 0
-    WIFCONTINUED: 0
+IFEXITED   : 1, EXITSTATUS : 0, IFSIGNALED : 0, TERMSIG    : 0, COREDUMP   : 0, IFSTOPPED  : 0, STOPSIG    : 0, IFCONTINUED: 0
+
 1 arg:
 arguments are:
@@ -17,12 +11,6 @@
 Success!
 Child status:
-    WIFEXITED   : 1
-    WEXITSTATUS : 0
-    WIFSIGNALED : 0
-    WTERMSIG    : 0
-    WCOREDUMP   : 0
-    WIFSTOPPED  : 0
-    WSTOPSIG    : 0
-    WIFCONTINUED: 0
+IFEXITED   : 1, EXITSTATUS : 0, IFSIGNALED : 0, TERMSIG    : 0, COREDUMP   : 0, IFSTOPPED  : 0, STOPSIG    : 0, IFCONTINUED: 0
+
 5 arg:
 arguments are:
@@ -34,11 +22,5 @@
 Success!
 Child status:
-    WIFEXITED   : 1
-    WEXITSTATUS : 0
-    WIFSIGNALED : 0
-    WTERMSIG    : 0
-    WCOREDUMP   : 0
-    WIFSTOPPED  : 0
-    WSTOPSIG    : 0
-    WIFCONTINUED: 0
+IFEXITED   : 1, EXITSTATUS : 0, IFSIGNALED : 0, TERMSIG    : 0, COREDUMP   : 0, IFSTOPPED  : 0, STOPSIG    : 0, IFCONTINUED: 0
+
 All Done!
Index: tests/meta/fork+exec.hfa
===================================================================
--- tests/meta/fork+exec.hfa	(revision a25bcf8ab29dde92e982540e533dcee4c347fd63)
+++ tests/meta/fork+exec.hfa	(revision 4af5396caad4605b138ead74b53857a746688724)
@@ -28,5 +28,5 @@
 }
 
-static int true_main(const char * exec, char * env[]);
+static int true_main(const char * path, char * env[]);
 
 static int do_wait(pid_t pid) {
@@ -55,12 +55,14 @@
 static void print_status(int wstatus) {
 	printf("Child status:\n");
-	printf("    WIFEXITED   : %d\n", WIFEXITED(wstatus));
-	printf("    WEXITSTATUS : %d\n", WEXITSTATUS(wstatus));
-	printf("    WIFSIGNALED : %d\n", WIFSIGNALED(wstatus));
-	printf("    WTERMSIG    : %d\n", WTERMSIG(wstatus));
-	printf("    WCOREDUMP   : %d\n", WCOREDUMP(wstatus));
-	printf("    WIFSTOPPED  : %d\n", WIFSTOPPED(wstatus));
-	printf("    WSTOPSIG    : %d\n", WSTOPSIG(wstatus));
-	printf("    WIFCONTINUED: %d\n", WIFCONTINUED(wstatus));
+	printf("IFEXITED   : %d, ", WIFEXITED(wstatus));
+	printf("EXITSTATUS : %d, ", WEXITSTATUS(wstatus));
+	printf("IFSIGNALED : %d, ", WIFSIGNALED(wstatus));
+	printf("TERMSIG    : %d, ", WTERMSIG(wstatus));
+	printf("COREDUMP   : %d, ", WCOREDUMP(wstatus));
+	printf("IFSTOPPED  : %d, ", WIFSTOPPED(wstatus));
+	printf("STOPSIG    : %d, ", WSTOPSIG(wstatus));
+	printf("IFCONTINUED: %d", WIFCONTINUED(wstatus));
+	printf("\n");
+	printf("\n");
 }
 
Index: tests/test.py
===================================================================
--- tests/test.py	(revision a25bcf8ab29dde92e982540e533dcee4c347fd63)
+++ tests/test.py	(revision 4af5396caad4605b138ead74b53857a746688724)
@@ -72,5 +72,5 @@
 				# this is a valid name, let's check if it already exists
 				found = [test for test in all_tests if canonical_path( test.target() ) == testname]
-				setup = itertools.product(settings.all_arch if options.arch else [None])
+				setup = settings.all_arch if options.arch else [None]
 				if not found:
 					# it's a new name, create it according to the name and specified architecture
