]> git.draconx.ca Git - cdecl99.git/blobdiff - test/testlib.c
Clean up declgen a bit.
[cdecl99.git] / test / testlib.c
index 7471ece57e11ccf33ecd2408e7be0e25f829815b..93186635639250a1d1e5867708eb5d66db477ea3 100644 (file)
 #include <stdio.h>
 #include <stdlib.h>
 #include <errno.h>
+#include <getopt.h>
 #include <cdecl.h>
+
+#include "help.h"
 #include "test.h"
 
 static size_t printbuf_size;
@@ -94,3 +97,14 @@ void test_print_version(const char *program)
        puts("This is free software: you are free to change and redistribute it.");
        puts("There is NO WARRANTY, to the extent permitted by law.");
 }
+
+void test_print_options(const struct option *lopts)
+{
+       const struct option *opt;
+
+       puts("Options:");
+       for (opt = lopts; opt->val; opt++) {
+               if (help_print_optstring(opt, "ARG", 20))
+                       putchar('\n');
+       }
+}