comparison 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
comparison
equal deleted inserted replaced
440:fda62f676ed4 441:b138b4005125
310 // enable the "forward reference maximum size" pragma; old available 310 // enable the "forward reference maximum size" pragma; old available
311 // can be obtained with --pragma=noforwardrefmax 311 // can be obtained with --pragma=noforwardrefmax
312 asmstate.pragmas = PRAGMA_FORWARDREFMAX; 312 asmstate.pragmas = PRAGMA_FORWARDREFMAX;
313 313
314 /* parse command line arguments */ 314 /* parse command line arguments */
315 lw_cmdline_parse(&cmdline_parser, argc, argv, 0, 0, &asmstate); 315 if (lw_cmdline_parse(&cmdline_parser, argc, argv, 0, 0, &asmstate) != 0)
316 {
317 exit(1);
318 }
316 319
317 if (!asmstate.output_file) 320 if (!asmstate.output_file)
318 { 321 {
319 asmstate.output_file = lw_strdup("a.out"); 322 asmstate.output_file = lw_strdup("a.out");
320 } 323 }