Patch from Jeff Garzik marking a few 'getopt not needed' apps.
[oweals/busybox.git] / date.c
diff --git a/date.c b/date.c
index 8b6a0620d19ee3bb4aeb030619feb66d513e9f0d..4b2f66add384cfc87b32eaf3d3bbb0922547df26 100644 (file)
--- a/date.c
+++ b/date.c
  *
 */
 
-#include "busybox.h"
-#define BB_DECLARE_EXTERN
-#define bb_need_invalid_date
-#define bb_need_memory_exhausted
-#include "messages.c"
 #include <stdlib.h>
 #include <errno.h>
 #include <sys/time.h>
 #include <stdio.h>
 #include <string.h>
 #include <getopt.h>
+#include "busybox.h"
+#define BB_DECLARE_EXTERN
+#define bb_need_invalid_date
+#define bb_need_memory_exhausted
+#include "messages.c"
 
 
 /* This 'date' command supports only 2 time setting formats, 
@@ -46,7 +46,7 @@
 
 /* Default input handling to save suprising some people */
 
-struct tm *date_conv_time(struct tm *tm_time, const char *t_string)
+static struct tm *date_conv_time(struct tm *tm_time, const char *t_string)
 {
        int nr;
 
@@ -73,7 +73,7 @@ struct tm *date_conv_time(struct tm *tm_time, const char *t_string)
 
 /* The new stuff for LRP */
 
-struct tm *date_conv_ftime(struct tm *tm_time, const char *t_string)
+static struct tm *date_conv_ftime(struct tm *tm_time, const char *t_string)
 {
        struct tm t;
 
@@ -151,7 +151,7 @@ int date_main(int argc, char **argv)
                        case 's':
                                set_time = 1;
                                if ((date_str != NULL) || ((date_str = optarg) == NULL)) {
-                                       usage(date_usage);
+                                       show_usage();
                                }
                                break;
                        case 'u':
@@ -162,10 +162,10 @@ int date_main(int argc, char **argv)
                        case 'd':
                                use_arg = 1;
                                if ((date_str != NULL) || ((date_str = optarg) == NULL))
-                                       usage(date_usage);
+                                       show_usage();
                                break;
                        default:
-                               usage(date_usage);
+                               show_usage();
                }
        }
 
@@ -178,7 +178,7 @@ int date_main(int argc, char **argv)
 #if 0
        else {
                error_msg("date_str='%s'  date_fmt='%s'\n", date_str, date_fmt);
-               usage(date_usage);
+               show_usage();
        }
 #endif