svn commit: samba r5425 - in branches/SAMBA_4_0/source/utils/net: .

mimir at samba.org mimir at samba.org
Wed Feb 16 21:54:02 GMT 2005


Author: mimir
Date: 2005-02-16 21:54:01 +0000 (Wed, 16 Feb 2005)
New Revision: 5425

WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=5425

Log:
Convert function tables to new structure (with description)
and remove unnecessary help functions as help is generated
automatically. Usage functions with precise information about
usage of each leaf node remain.


rafal


Modified:
   branches/SAMBA_4_0/source/utils/net/net_password.c
   branches/SAMBA_4_0/source/utils/net/net_time.c
   branches/SAMBA_4_0/source/utils/net/net_user.c


Changeset:
Modified: branches/SAMBA_4_0/source/utils/net/net_password.c
===================================================================
--- branches/SAMBA_4_0/source/utils/net/net_password.c	2005-02-16 21:51:37 UTC (rev 5424)
+++ branches/SAMBA_4_0/source/utils/net/net_password.c	2005-02-16 21:54:01 UTC (rev 5425)
@@ -29,6 +29,13 @@
  * Code for Changing and setting a password
  */
 
+static int net_password_change_usage(struct net_context *ctx, int argc, const char **argv)
+{
+	d_printf("net_password_change_usage: TODO\n");
+	return 0;	
+}
+
+
 static int net_password_change(struct net_context *ctx, int argc, const char **argv)
 {
 	NTSTATUS status;
@@ -72,18 +79,14 @@
 	return 0;
 }
 
-static int net_password_change_usage(struct net_context *ctx, int argc, const char **argv)
-{
-	d_printf("net_password_change_usage: TODO\n");
-	return 0;	
-}
 
-static int net_password_change_help(struct net_context *ctx, int argc, const char **argv)
+static int net_password_set_usage(struct net_context *ctx, int argc, const char **argv)
 {
-	d_printf("net_password_change_help: TODO\n");
+	d_printf("net_password_set_usage: TODO\n");
 	return 0;	
 }
 
+
 static int net_password_set(struct net_context *ctx, int argc, const char **argv)
 {
 	NTSTATUS status;
@@ -98,7 +101,7 @@
 
 	switch (argc) {
 		case 0: /* no args -> fail */
-			return net_password_usage(ctx, argc, argv);
+			return net_password_set_usage(ctx, argc, argv);
 		case 1: /* only DOM\\user; prompt for password */
 			tmp = talloc_strdup(ctx->mem_ctx, argv[0]);
 			break;
@@ -152,22 +155,10 @@
 	return 0;
 }
 
-static int net_password_set_usage(struct net_context *ctx, int argc, const char **argv)
-{
-	d_printf("net_password_set_usage: TODO\n");
-	return 0;	
-}
 
-static int net_password_set_help(struct net_context *ctx, int argc, const char **argv)
-{
-	d_printf("net_password_set_help: TODO\n");
-	return 0;	
-}
-
 static const struct net_functable net_password_functable[] = {
-	{"change", net_password_change, net_password_change_usage,  net_password_change_help},
-	{"set", net_password_set, net_password_set_usage,  net_password_set_help},
-	{"help", net_password_help, net_password_help, net_password_help},
+	{"change", "change password (old password required)\n", net_password_change, net_password_change_usage },
+	{"set", "set password\n", net_password_set, net_password_set_usage },
 	{NULL, NULL}
 };
 
@@ -181,11 +172,3 @@
 	d_printf("net password <command> [options]\n");
 	return 0;	
 }
-
-int net_password_help(struct net_context *ctx, int argc, const char **argv)
-{
-	d_printf("Account password handling:\n");
-	d_printf("\tchange\t\tchanges password (old password required)\n");
-	d_printf("\tset\t\tsets password\n");
-	return 0;	
-}

Modified: branches/SAMBA_4_0/source/utils/net/net_time.c
===================================================================
--- branches/SAMBA_4_0/source/utils/net/net_time.c	2005-02-16 21:51:37 UTC (rev 5424)
+++ branches/SAMBA_4_0/source/utils/net/net_time.c	2005-02-16 21:54:01 UTC (rev 5425)
@@ -78,9 +78,3 @@
 	d_printf("net time <server> [options]\n");
 	return 0;	
 }
-
-int net_time_help(struct net_context *ctx, int argc, const char **argv)
-{
-	d_printf("Displays remote server's time.\n");
-	return 0;	
-}

Modified: branches/SAMBA_4_0/source/utils/net/net_user.c
===================================================================
--- branches/SAMBA_4_0/source/utils/net/net_user.c	2005-02-16 21:51:37 UTC (rev 5424)
+++ branches/SAMBA_4_0/source/utils/net/net_user.c	2005-02-16 21:54:01 UTC (rev 5425)
@@ -69,8 +69,7 @@
 
 
 static const struct net_functable net_user_functable[] = {
-	{ "add", net_user_add, net_user_usage, net_user_help },
-	{ "help", net_user_help, net_user_usage, net_user_help },
+	{ "add", "create new user account\n", net_user_add, net_user_usage },
 	{ NULL, NULL }
 };
 
@@ -81,14 +80,6 @@
 }
 
 
-int net_user_help(struct net_context *ctx, int argc, const char **argv)
-{
-	d_printf("User accounts management:\n");
-	d_printf("\tadd\t\tcreates new account\n");
-	return 0;
-}
-
-
 int net_user_usage(struct net_context *ctx, int argc, const char **argv)
 {
 	d_printf("net user <command> [options]\n");



More information about the samba-cvs mailing list