From 4ca96834f3b77757d1e03fbc5290677b6724b785 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Wed, 11 Aug 2010 13:35:14 +1000 Subject: s3-param: added lp_set_cmdline() and --option= parameter Pair-Programmed-With: Andrew Bartlett --- source3/lib/popt_common.c | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'source3/lib') diff --git a/source3/lib/popt_common.c b/source3/lib/popt_common.c index 9dd438b7f7..a332cde566 100644 --- a/source3/lib/popt_common.c +++ b/source3/lib/popt_common.c @@ -34,6 +34,8 @@ * -i,--scope */ +enum {OPT_OPTION=1}; + extern bool AllowDebugChange; extern bool override_logfile; @@ -96,6 +98,13 @@ static void popt_common_callback(poptContext con, } switch(opt->val) { + case OPT_OPTION: + if (!lp_set_option(arg)) { + fprintf(stderr, "Error setting option '%s'\n", arg); + exit(1); + } + break; + case 'd': if (arg) { debug_parse_levels(arg); @@ -164,6 +173,7 @@ struct poptOption popt_common_samba[] = { { "configfile", 's', POPT_ARG_STRING, NULL, 's', "Use alternate configuration file", "CONFIGFILE" }, { "log-basename", 'l', POPT_ARG_STRING, NULL, 'l', "Base name for log files", "LOGFILEBASE" }, { "version", 'V', POPT_ARG_NONE, NULL, 'V', "Print version" }, + { "option", 0, POPT_ARG_STRING, NULL, OPT_OPTION, "Set smb.conf option from command line", "name=value" }, POPT_TABLEEND }; -- cgit