r5400: Slightly better handling of help messages in net tool.
[bbaumbach/samba-autobuild/.git] / source4 / utils / net / net_time.c
index d2df76bc5d0333cd6aca8956021fb4a7a0cc1613..ce7db4ab5c08462e6f36ddb79fb2de119e06d72a 100644 (file)
@@ -28,7 +28,6 @@
  * Code for getting the remote time
  */
 
-
 int net_time(struct net_context *ctx, int argc, const char **argv)
 {
        NTSTATUS status;
@@ -41,8 +40,7 @@ int net_time(struct net_context *ctx, int argc, const char **argv)
        if (argc > 0 && argv[0]) {
                server_name = argv[0];
        } else {
-               DEBUG(0,("net_time: server name needed!\n"));
-               return -1;
+               return net_time_usage(ctx, argc, argv);
        }
 
        libnetctx = libnet_context_init();
@@ -64,7 +62,7 @@ int net_time(struct net_context *ctx, int argc, const char **argv)
                return -1;
        }
 
-       ZERO_ARRAY(timestr);
+       ZERO_STRUCT(timestr);
        tm = localtime(&r.generic.out.time);
        strftime(timestr, sizeof(timestr)-1, "%c %Z",tm);
 
@@ -77,12 +75,12 @@ int net_time(struct net_context *ctx, int argc, const char **argv)
 
 int net_time_usage(struct net_context *ctx, int argc, const char **argv)
 {
-       d_printf("net_time_usage: TODO\n");
+       d_printf("net time <server> [options]\n");
        return 0;       
 }
 
 int net_time_help(struct net_context *ctx, int argc, const char **argv)
 {
-       d_printf("net_time_help: TODO\n");
+       d_printf("Displays remote server's time.\n");
        return 0;       
 }