From dbac75b466831cade91dfad21a2bcbe4bd551b37 Mon Sep 17 00:00:00 2001 From: Michael Adam Date: Tue, 15 Jul 2008 11:26:11 +0200 Subject: popt: add a popt_common_debuglevel set of options providing -d|--debuglevel Michael (This used to be commit e7d08b673066a63aaa7ab54ac59566ae8a975672) --- source3/include/popt_common.h | 2 ++ source3/lib/popt_common.c | 6 ++++++ 2 files changed, 8 insertions(+) (limited to 'source3') diff --git a/source3/include/popt_common.h b/source3/include/popt_common.h index c889d2e6e6..bbd013a18f 100644 --- a/source3/include/popt_common.h +++ b/source3/include/popt_common.h @@ -28,6 +28,7 @@ extern struct poptOption popt_common_connection[]; 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 const struct poptOption popt_common_dynconfig[]; #ifndef POPT_TABLEEND @@ -42,6 +43,7 @@ extern const struct poptOption popt_common_dynconfig[]; #define POPT_COMMON_DYNCONFIG { NULL, 0, POPT_ARG_INCLUDE_TABLE, \ 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 }, struct user_auth_info { char *username; diff --git a/source3/lib/popt_common.c b/source3/lib/popt_common.c index 25e41ab5f3..b151f22742 100644 --- a/source3/lib/popt_common.c +++ b/source3/lib/popt_common.c @@ -171,6 +171,12 @@ struct poptOption popt_common_version[] = { POPT_TABLEEND }; +struct poptOption popt_common_debuglevel[] = { + { NULL, 0, POPT_ARG_CALLBACK, (void *)popt_common_callback }, + { "debuglevel", 'd', POPT_ARG_STRING, NULL, 'd', "Set debug level", "DEBUGLEVEL" }, + POPT_TABLEEND +}; + /* Handle command line options: * --sbindir -- cgit