summaryrefslogtreecommitdiff
path: root/source3/lib
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2010-08-11 13:35:14 +1000
committerAndrew Tridgell <tridge@samba.org>2010-09-02 13:37:08 +1000
commit4ca96834f3b77757d1e03fbc5290677b6724b785 (patch)
tree89ea4850a9b72baaf8862f28af759924294d8318 /source3/lib
parentf6a631bdec3ec2aba8a923136b66edf36273d9f2 (diff)
downloadsamba-4ca96834f3b77757d1e03fbc5290677b6724b785.tar.gz
samba-4ca96834f3b77757d1e03fbc5290677b6724b785.tar.bz2
samba-4ca96834f3b77757d1e03fbc5290677b6724b785.zip
s3-param: added lp_set_cmdline() and --option= parameter
Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>
Diffstat (limited to 'source3/lib')
-rw-r--r--source3/lib/popt_common.c10
1 files changed, 10 insertions, 0 deletions
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
};