summaryrefslogtreecommitdiff
path: root/libshouldbeinlibc/argp-ex1.c
diff options
context:
space:
mode:
Diffstat (limited to 'libshouldbeinlibc/argp-ex1.c')
-rw-r--r--libshouldbeinlibc/argp-ex1.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/libshouldbeinlibc/argp-ex1.c b/libshouldbeinlibc/argp-ex1.c
new file mode 100644
index 00000000..7eeb907a
--- /dev/null
+++ b/libshouldbeinlibc/argp-ex1.c
@@ -0,0 +1,13 @@
+/* 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 <argp.h>
+
+int main (int argc, char **argv)
+{
+ argp_parse (0, argc, argv, 0, 0, 0);
+ exit (0);
+}