summaryrefslogtreecommitdiff
path: root/test/argp/argp-ex1.c
diff options
context:
space:
mode:
Diffstat (limited to 'test/argp/argp-ex1.c')
-rw-r--r--test/argp/argp-ex1.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/test/argp/argp-ex1.c b/test/argp/argp-ex1.c
new file mode 100644
index 000000000..7bb5f2241
--- /dev/null
+++ b/test/argp/argp-ex1.c
@@ -0,0 +1,15 @@
+/* Argp example #1 -- a minimal program using argp */
+
+/* This is (probably) the smallest possible program that
+ uses argp. It won't do much except give an error
+ messages and exit when there are any arguments, and print
+ a (rather pointless) messages for --help. */
+
+#include <stdlib.h>
+#include <argp.h>
+
+int main (int argc, char **argv)
+{
+ argp_parse (0, argc, argv, 0, 0, 0);
+ exit (0);
+}