]> git.ozlabs.org Git - ccan/commitdiff
tools/configurator: Better argument handling, particularly unknown arguments.
authorRusty Russell <rusty@rustcorp.com.au>
Tue, 12 Jun 2018 02:33:51 +0000 (12:03 +0930)
committerRusty Russell <rusty@rustcorp.com.au>
Tue, 12 Jun 2018 02:33:51 +0000 (12:03 +0930)
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
tools/configurator/configurator.c

index dae15446e67417ef8f02d3d07b259dbe33925963..afb67ca8ce269dcdae605de0c1a6913f4aaa9b8f 100644 (file)
@@ -752,6 +752,10 @@ int main(int argc, const char *argv[])
                        headerfile = argv[1] + 14;
                        argc--;
                        argv++;
+               } else if (strcmp(argv[1], "--") == 0) {
+                       break;
+               } else if (argv[1][0] == '-') {
+                       c12r_errx(2, "Unknown option %s", argv[1]);
                } else {
                        break;
                }