summaryrefslogtreecommitdiff
path: root/source4/utils
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2004-08-19 12:24:58 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 12:58:11 -0500
commit5c9c6b47412e93caab4c55086f679fb12fc9a9af (patch)
tree41e71e6e7d27a7148e99705ffd9f7938b60c91af /source4/utils
parent927e8242c1ca28012ba466c905de03b92c14883b (diff)
downloadsamba-5c9c6b47412e93caab4c55086f679fb12fc9a9af.tar.gz
samba-5c9c6b47412e93caab4c55086f679fb12fc9a9af.tar.bz2
samba-5c9c6b47412e93caab4c55086f679fb12fc9a9af.zip
r1914: use common popt stuff in net
metze (This used to be commit 52b866c40332ab408c57a0eab415e0755e4b5081)
Diffstat (limited to 'source4/utils')
-rw-r--r--source4/utils/net/net.c17
1 files changed, 8 insertions, 9 deletions
diff --git a/source4/utils/net/net.c b/source4/utils/net/net.c
index b6b3fb6fb9..05dbb35f41 100644
--- a/source4/utils/net/net.c
+++ b/source4/utils/net/net.c
@@ -158,9 +158,12 @@ static int binary_net(int argc, const char **argv)
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 @@ static int binary_net(int argc, const char **argv)
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));