add an extra level of indirection to main()
[gitweb.git] / test-date.c
index 94a6997a8f6aa40cd86859dbd3eb27704e46b034..0f3cfb1721b641b25267458edce93c9de2f923e2 100644 (file)
@@ -5,7 +5,7 @@ static const char *usage_msg = "\n"
 "  test-date parse [date]...\n"
 "  test-date approxidate [date]...\n";
 
-static void show_dates(char **argv, struct timeval *now)
+static void show_dates(const char **argv, struct timeval *now)
 {
        struct strbuf buf = STRBUF_INIT;
 
@@ -17,7 +17,7 @@ static void show_dates(char **argv, struct timeval *now)
        strbuf_release(&buf);
 }
 
-static void parse_dates(char **argv, struct timeval *now)
+static void parse_dates(const char **argv, struct timeval *now)
 {
        struct strbuf result = STRBUF_INIT;
 
@@ -29,23 +29,23 @@ static void parse_dates(char **argv, struct timeval *now)
                parse_date(*argv, &result);
                if (sscanf(result.buf, "%lu %d", &t, &tz) == 2)
                        printf("%s -> %s\n",
-                              *argv, show_date(t, tz, DATE_ISO8601));
+                              *argv, show_date(t, tz, DATE_MODE(ISO8601)));
                else
                        printf("%s -> bad\n", *argv);
        }
        strbuf_release(&result);
 }
 
-static void parse_approxidate(char **argv, struct timeval *now)
+static void parse_approxidate(const char **argv, struct timeval *now)
 {
        for (; *argv; argv++) {
                time_t t;
                t = approxidate_relative(*argv, now);
-               printf("%s -> %s\n", *argv, show_date(t, 0, DATE_ISO8601));
+               printf("%s -> %s\n", *argv, show_date(t, 0, DATE_MODE(ISO8601)));
        }
 }
 
-int main(int argc, char **argv)
+int cmd_main(int argc, const char **argv)
 {
        struct timeval now;
        const char *x;