Index: libcfa/src/parseargs.cfa
===================================================================
--- libcfa/src/parseargs.cfa	(revision 325e6ea3f194ad588ab061cdd3cc9daa9ebcc1c3)
+++ libcfa/src/parseargs.cfa	(revision 80d3b1b7f74f56e30349c86d0274682b79873a20)
@@ -30,5 +30,23 @@
 
 static void usage(char * cmd, cfa_option options[], size_t opt_count, const char * usage, FILE * out)  __attribute__ ((noreturn));
-
+//-----------------------------------------------------------------------------
+// checking
+static void check_args(cfa_option options[], size_t opt_count) {
+	for(i; opt_count) {
+		for(j; opt_count) {
+			if(i == j) continue;
+
+			if( options[i].short_name != '\0'
+			&& options[i].short_name == options[j].short_name)
+				abort("Parse Args error: two options have short name '%c' (%d & %d)", options[i].short_name, i, j);
+
+			if(0 == strcmp(options[i].long_name, options[j].long_name)) abort("Parse Args error: two options have long name '%s' (%d & %d)", options[i].long_name, i, j);
+		}
+	}
+}
+
+
+//-----------------------------------------------------------------------------
+// Parsing args
 void parse_args( cfa_option options[], size_t opt_count, const char * usage, char ** & left ) {
 	if( 0p != &cfa_args_argc ) {
@@ -41,6 +59,4 @@
 }
 
-//-----------------------------------------------------------------------------
-// getopt_long wrapping
 void parse_args(
 	int argc,
@@ -51,4 +67,26 @@
 	char ** & left
 ) {
+	check_args(options, opt_count);
+
+	int maxv = 'h';
+	char optstring[opt_count * 3] = { '\0' };
+	{
+		int idx = 0;
+		for(i; opt_count) {
+			if (options[i].short_name) {
+				maxv = max(options[i].short_name, maxv);
+				optstring[idx] = options[i].short_name;
+				idx++;
+				if(    ((intptr_t)options[i].parse) != ((intptr_t)parse_settrue)
+				&& ((intptr_t)options[i].parse) != ((intptr_t)parse_setfalse) ) {
+					optstring[idx] = ':';
+					idx++;
+				}
+			}
+		}
+		optstring[idx+0] = 'h';
+		optstring[idx+1] = '\0';
+	}
+
 	struct option optarr[opt_count + 2];
 	{
@@ -56,7 +94,8 @@
 		for(i; opt_count) {
 			if(options[i].long_name) {
+				options[i].val = (options[i].short_name != '\0') ? ((int)options[i].short_name) : ++maxv;
 				optarr[idx].name = options[i].long_name;
 				optarr[idx].flag = 0p;
-				optarr[idx].val  = options[i].short_name;
+				optarr[idx].val  = options[i].val;
 				if(    ((intptr_t)options[i].parse) == ((intptr_t)parse_settrue)
 				    || ((intptr_t)options[i].parse) == ((intptr_t)parse_setfalse) ) {
@@ -70,20 +109,4 @@
 		optarr[idx+0].[name, has_arg, flag, val] = ["help", no_argument, 0, 'h'];
 		optarr[idx+1].[name, has_arg, flag, val] = [0, no_argument, 0, 0];
-	}
-
-	char optstring[opt_count * 3] = { '\0' };
-	{
-		int idx = 0;
-		for(i; opt_count) {
-			optstring[idx] = options[i].short_name;
-			idx++;
-			if(    ((intptr_t)options[i].parse) != ((intptr_t)parse_settrue)
-			    && ((intptr_t)options[i].parse) != ((intptr_t)parse_setfalse) ) {
-				optstring[idx] = ':';
-				idx++;
-			}
-		}
-		optstring[idx+0] = 'h';
-		optstring[idx+1] = '\0';
 	}
 
@@ -103,5 +126,5 @@
 			default:
 				for(i; opt_count) {
-					if(opt == options[i].short_name) {
+					if(opt == options[i].val) {
 						const char * arg = optarg ? optarg : "";
 						if( arg[0] == '=' ) { arg++; }
Index: libcfa/src/parseargs.hfa
===================================================================
--- libcfa/src/parseargs.hfa	(revision 325e6ea3f194ad588ab061cdd3cc9daa9ebcc1c3)
+++ libcfa/src/parseargs.hfa	(revision 80d3b1b7f74f56e30349c86d0274682b79873a20)
@@ -2,4 +2,5 @@
 
 struct cfa_option {
+      int val; // reserved
       char short_name;
       const char * long_name;
@@ -15,4 +16,5 @@
 forall(dtype T | { bool parse(const char *, T & ); })
 static inline void ?{}( cfa_option & this, char short_name, const char * long_name, const char * help, T & variable ) {
+      this.val        = 0;
       this.short_name = short_name;
       this.long_name  = long_name;
@@ -24,4 +26,5 @@
 forall(dtype T)
 static inline void ?{}( cfa_option & this, char short_name, const char * long_name, const char * help, T & variable, bool (*parse)(const char *, T & )) {
+      this.val        = 0;
       this.short_name = short_name;
       this.long_name  = long_name;
