]> git.ozlabs.org Git - ccan/blobdiff - ccan/opt/test/run-correct-reporting.c
opt: add opt_log_stderr_exit helper, and opt_usage NULL option.
[ccan] / ccan / opt / test / run-correct-reporting.c
index 44f68ae2034b01d7146e6ac50a80f72346dbfbb2..2dc62656ff7c9fc7253d85c2081dafd8bf86946f 100644 (file)
@@ -4,6 +4,7 @@
 #include <stdlib.h>
 #include <ccan/opt/opt.c>
 #include <ccan/opt/usage.c>
+#include <ccan/opt/helpers.c>
 #include "utils.h"
 
 int main(int argc, char *argv[])
@@ -11,7 +12,7 @@ int main(int argc, char *argv[])
        plan_tests(12);
 
        /* --aaa without args. */
-       opt_register_arg("-a/--aaa", test_arg, NULL, "aaa", NULL);
+       opt_register_arg("-a/--aaa", test_arg, NULL, "aaa", "");
        ok1(!parse_args(&argc, &argv, "--aaa", NULL));
        ok1(strstr(err_output, ": --aaa: option requires an argument"));
        free(err_output);
@@ -22,7 +23,7 @@ int main(int argc, char *argv[])
        err_output = NULL;
 
        /* Multiple */
-       opt_register_arg("--bbb/-b/-c/--ccc", test_arg, NULL, "aaa", NULL);
+       opt_register_arg("--bbb/-b/-c/--ccc", test_arg, NULL, "aaa", "");
        ok1(!parse_args(&argc, &argv, "--bbb", NULL));
        ok1(strstr(err_output, ": --bbb: option requires an argument"));
        free(err_output);