diff lwasm/main.c @ 441:b138b4005125

Make missing command line arguments fail properly Actually make lwasm, lwlink, and lwar exit with a nonzero status if command line argument parsing fails due to missing arguments. This required adjustments to lw_cmdline to return error codes in those cases.
author William Astle <lost@l-w.ca>
date Mon, 27 Nov 2017 22:35:53 -0700
parents 58cafa61ab40
children 61580fc48f98
line wrap: on
line diff
--- a/lwasm/main.c	Mon Nov 27 22:21:42 2017 -0700
+++ b/lwasm/main.c	Mon Nov 27 22:35:53 2017 -0700
@@ -312,7 +312,10 @@
 	asmstate.pragmas = PRAGMA_FORWARDREFMAX;
 	
 	/* parse command line arguments */	
-	lw_cmdline_parse(&cmdline_parser, argc, argv, 0, 0, &asmstate);
+	if (lw_cmdline_parse(&cmdline_parser, argc, argv, 0, 0, &asmstate) != 0)
+	{
+		exit(1);
+	}
 
 	if (!asmstate.output_file)
 	{