Mercurial > hg > index.cgi
diff lwar/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 | e34c8bd6ea29 |
children | 96a05e89ab03 |
line wrap: on
line diff
--- a/lwar/main.c Mon Nov 27 22:21:42 2017 -0700 +++ b/lwar/main.c Mon Nov 27 22:35:53 2017 -0700 @@ -143,7 +143,10 @@ int main(int argc, char **argv) { program_name = argv[0]; - lw_cmdline_parse(&argparser, argc, argv, 0, 0, NULL); + if (lw_cmdline_parse(&argparser, argc, argv, 0, 0, NULL) != 0) + { + exit(1); + } if (archive_file == NULL) { fprintf(stderr, "You must specify an archive file.\n");