summaryrefslogtreecommitdiff
path: root/source4/param
diff options
context:
space:
mode:
Diffstat (limited to 'source4/param')
-rw-r--r--source4/param/loadparm.c27
1 files changed, 27 insertions, 0 deletions
diff --git a/source4/param/loadparm.c b/source4/param/loadparm.c
index 0d7bbb6d18..7ae4a29483 100644
--- a/source4/param/loadparm.c
+++ b/source4/param/loadparm.c
@@ -2639,6 +2639,33 @@ BOOL lp_set_cmdline(const char *pszParmName, const char *pszParmValue)
return True;
}
+/*
+ set a option from the commandline in 'a=b' format. Use to support --option
+*/
+BOOL lp_set_option(const char *option)
+{
+ char *p, *s;
+ BOOL ret;
+
+ s = strdup(option);
+ if (!s) {
+ return False;
+ }
+
+ p = strchr(s, '=');
+ if (!p) {
+ free(s);
+ return False;
+ }
+
+ *p = 0;
+
+ ret = lp_set_cmdline(s, p+1);
+ free(s);
+ return ret;
+}
+
+
/***************************************************************************
Print a parameter of the specified type.
***************************************************************************/