svn commit: samba r1914 - branches/SAMBA_4_0/source/utils/net

metze at samba.org metze at samba.org
Thu Aug 19 12:24:58 GMT 2004


Author: metze
Date: 2004-08-19 12:24:58 +0000 (Thu, 19 Aug 2004)
New Revision: 1914

WebSVN: http://websvn.samba.org/websvn/changeset.php?rep=samba&path=/&rev=1914&nolog=1

Log:
use common popt stuff in net

metze

Modified:
   branches/SAMBA_4_0/source/utils/net/net.c


Changeset:
Modified: branches/SAMBA_4_0/source/utils/net/net.c
===================================================================
--- branches/SAMBA_4_0/source/utils/net/net.c	2004-08-19 12:23:57 UTC (rev 1913)
+++ branches/SAMBA_4_0/source/utils/net/net.c	2004-08-19 12:24:58 UTC (rev 1914)
@@ -158,9 +158,12 @@
 	struct net_context *ctx;
 	poptContext pc;
 	struct poptOption long_options[] = {
-		{"help",	'h', POPT_ARG_NONE,   0, 'h'},
-		{NULL, 0, POPT_ARG_INCLUDE_TABLE, popt_common_version},
-		{ 0, 0, 0, 0}
+		POPT_AUTOHELP
+		POPT_COMMON_SAMBA
+		POPT_COMMON_CONNECTION
+		POPT_COMMON_CREDENTIALS
+		POPT_COMMON_VERSION
+		POPT_TABLEEND
 	};
 
 	setup_logging("net", DEBUG_STDOUT);
@@ -179,15 +182,11 @@
 	ZERO_STRUCTP(ctx);
 	ctx->mem_ctx = mem_ctx;
 
-	pc = poptGetContext(NULL, argc, (const char **) argv, long_options, 
-			    POPT_CONTEXT_KEEP_FIRST);
+	pc = poptGetContext("net", argc, (const char **) argv, long_options, 
+				POPT_CONTEXT_KEEP_FIRST);
 
 	while((opt = poptGetNextOpt(pc)) != -1) {
 		switch (opt) {
-		case 'h':
-			net_help(ctx, argc, argv);
-			exit(0);
-			break;
 		default:
 			d_printf("Invalid option %s: %s\n", 
 				 poptBadOption(pc, 0), poptStrerror(opt));



More information about the samba-cvs mailing list