]> git.ozlabs.org Git - ccan/blobdiff - ccan/opt/test/compile_ok-const-arg.c
opt: allow const arguments.
[ccan] / ccan / opt / test / compile_ok-const-arg.c
diff --git a/ccan/opt/test/compile_ok-const-arg.c b/ccan/opt/test/compile_ok-const-arg.c
new file mode 100644 (file)
index 0000000..f1d10da
--- /dev/null
@@ -0,0 +1,13 @@
+#include <ccan/opt/opt.h>
+#include <ccan/opt/opt.c>
+#include <ccan/opt/helpers.c>
+#include <ccan/opt/parse.c>
+#include <ccan/opt/usage.c>
+
+int main(int argc, char *argv[])
+{
+       opt_register_noarg("-v", opt_version_and_exit,
+                          (const char *)"1.2.3",
+                          (const char *)"Print version");
+       return 0;
+}