summaryrefslogtreecommitdiff
path: root/source3/lib/popt_common.c
diff options
context:
space:
mode:
Diffstat (limited to 'source3/lib/popt_common.c')
-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
};