summaryrefslogtreecommitdiffstats
path: root/main.c
diff options
context:
space:
mode:
Diffstat (limited to 'main.c')
-rw-r--r--main.c23
1 files changed, 23 insertions, 0 deletions
diff --git a/main.c b/main.c
new file mode 100644
index 0000000..9e78c04
--- /dev/null
+++ b/main.c
@@ -0,0 +1,23 @@
+#include <stdio.h>
+#include "posixtz.h"
+
+int usage() {
+ printf("Print POSIX TZ string from compiled tzdata\n"
+ "Usage: posixtz FILE...\n");
+ return -1;
+}
+
+int main(int argc, char *argv[])
+{
+ int i=1;
+ if (argc <= 1)
+ return usage();
+
+ for (i = 1; i < argc; i++) {
+ char *s = posix_tz(argv[i++]);
+ if (s != NULL)
+ printf("%s\n", s);
+ }
+ return 0;
+}
+