From 8a6b05d36d460a1814e72f634835604f48f570d9 Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Sat, 2 Nov 2002 16:16:15 +0000 Subject: Add more options to popt_common and use them. Current ones are: -V Version information -n Set netbios name -l Set directory to store log files in -d Set debuglevel -s Load specified configuration file -O Set socket options (This used to be commit 1602d5894947b59fd36c161053a66c0afe2c959c) --- source3/nmbd/nmbd.c | 28 +++++++--------------------- 1 file changed, 7 insertions(+), 21 deletions(-) (limited to 'source3/nmbd') diff --git a/source3/nmbd/nmbd.c b/source3/nmbd/nmbd.c index 7aa4479c0f..29caa64abc 100644 --- a/source3/nmbd/nmbd.c +++ b/source3/nmbd/nmbd.c @@ -675,15 +675,12 @@ static BOOL init_structs(void) {"port", 'p', POPT_ARG_INT, &global_nmb_port, NMB_PORT, "Listen on the specified port" }, {NULL, 0, POPT_ARG_INCLUDE_TABLE, popt_common_debug }, {NULL, 0, POPT_ARG_INCLUDE_TABLE, popt_common_configfile }, - /* Various obsolete options */ - {NULL, 'N', POPT_ARG_NONE | POPT_ARGFLAG_DOC_HIDDEN }, - {NULL, 'B', POPT_ARG_NONE | POPT_ARGFLAG_DOC_HIDDEN }, - {NULL, 'I', POPT_ARG_NONE | POPT_ARGFLAG_DOC_HIDDEN }, - {NULL, 'C', POPT_ARG_NONE | POPT_ARGFLAG_DOC_HIDDEN }, - {NULL, 'G', POPT_ARG_NONE | POPT_ARGFLAG_DOC_HIDDEN }, + {NULL, 0, POPT_ARG_INCLUDE_TABLE, popt_common_socket_options }, + {NULL, 0, POPT_ARG_INCLUDE_TABLE, popt_common_version }, + {NULL, 0, POPT_ARG_INCLUDE_TABLE, popt_common_netbios_name }, + {NULL, 0, POPT_ARG_INCLUDE_TABLE, popt_common_log_base }, { NULL } }; - extern BOOL append_log; int opt; pstring logfile; @@ -719,24 +716,13 @@ static BOOL init_structs(void) #if defined(SIGUSR2) BlockSignals(True, SIGUSR2); #endif - pc = poptGetContext(argv[0], argc, argv, long_options, 0); + pc = poptGetContext("nmbd", argc, argv, long_options, 0); while((opt = poptGetNextOpt(pc)) != -1) - { - switch (opt) - { - case 'N': - case 'B': - case 'I': - case 'C': - case 'G': - DEBUG(0,("Obsolete option '%c' used\n",opt)); - break; - } - } + { } poptFreeContext(pc); - + setup_logging( argv[0], opt_interactive ); reopen_logs(); -- cgit