summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Adam <obnox@samba.org>2011-02-09 13:44:42 +0100
committerMichael Adam <obnox@samba.org>2011-02-09 14:00:34 +0100
commit015b47fa149851e5e332c38926badc3e85cba68d (patch)
tree2633435501d103c2c1316f96092713647bee0775
parentc6f797d020e5192be93fb4b006e984f5e1d63d75 (diff)
downloadsamba-015b47fa149851e5e332c38926badc3e85cba68d.tar.gz
samba-015b47fa149851e5e332c38926badc3e85cba68d.tar.bz2
samba-015b47fa149851e5e332c38926badc3e85cba68d.zip
s3:popt: add POPT_COMMON_OPTION to provide only the "--option" feature
-rw-r--r--source3/include/popt_common.h2
-rw-r--r--source3/lib/popt_common.c5
2 files changed, 7 insertions, 0 deletions
diff --git a/source3/include/popt_common.h b/source3/include/popt_common.h
index 040fae9b21..70d7278f01 100644
--- a/source3/include/popt_common.h
+++ b/source3/include/popt_common.h
@@ -29,6 +29,7 @@ extern struct poptOption popt_common_configfile[];
extern struct poptOption popt_common_version[];
extern struct poptOption popt_common_credentials[];
extern struct poptOption popt_common_debuglevel[];
+extern struct poptOption popt_common_option[];
extern const struct poptOption popt_common_dynconfig[];
#ifndef POPT_TABLEEND
@@ -44,6 +45,7 @@ extern const struct poptOption popt_common_dynconfig[];
CONST_DISCARD(poptOption *, popt_common_dynconfig), 0, \
"Build-time configuration overrides:", NULL },
#define POPT_COMMON_DEBUGLEVEL { NULL, 0, POPT_ARG_INCLUDE_TABLE, popt_common_debuglevel, 0, "Common samba debugging:", NULL },
+#define POPT_COMMON_OPTION { NULL, 0, POPT_ARG_INCLUDE_TABLE, popt_common_option, 0, "Common samba commandline config:", NULL },
struct user_auth_info {
char *username;
diff --git a/source3/lib/popt_common.c b/source3/lib/popt_common.c
index 32906432df..8ff2b8023b 100644
--- a/source3/lib/popt_common.c
+++ b/source3/lib/popt_common.c
@@ -193,6 +193,11 @@ struct poptOption popt_common_debuglevel[] = {
POPT_TABLEEND
};
+struct poptOption popt_common_option[] = {
+ { NULL, 0, POPT_ARG_CALLBACK|POPT_CBFLAG_POST, (void *)popt_common_callback },
+ { "option", 0, POPT_ARG_STRING, NULL, OPT_OPTION, "Set smb.conf option from command line", "name=value" },
+ POPT_TABLEEND
+};
/* Handle command line options:
* --sbindir