mirror of
https://github.com/samba-team/samba.git
synced 2024-12-23 17:34:34 +03:00
s3:lib: Migrate smbconftort to new cmdline option parser
Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
This commit is contained in:
parent
b87c36cb78
commit
0f6c86b201
@ -18,7 +18,7 @@
|
||||
*/
|
||||
|
||||
#include "includes.h"
|
||||
#include "popt_common.h"
|
||||
#include "lib/cmdline/cmdline.h"
|
||||
#include "lib/smbconf/smbconf.h"
|
||||
#include "lib/smbconf/smbconf_init.h"
|
||||
#include "lib/smbconf/smbconf_reg.h"
|
||||
@ -293,26 +293,34 @@ int main(int argc, const char **argv)
|
||||
|
||||
struct poptOption long_options[] = {
|
||||
POPT_COMMON_SAMBA
|
||||
POPT_COMMON_VERSION
|
||||
POPT_TABLEEND
|
||||
};
|
||||
|
||||
smb_init_locale();
|
||||
setup_logging(argv[0], DEBUG_STDERR);
|
||||
|
||||
ret = samba_cmdline_init(mem_ctx,
|
||||
SAMBA_CMDLINE_CONFIG_CLIENT,
|
||||
true /* require_smbconf */);
|
||||
if (!ret) {
|
||||
goto done;
|
||||
}
|
||||
|
||||
/* parse options */
|
||||
pc = poptGetContext("smbconftort", argc, (const char **)argv,
|
||||
long_options, 0);
|
||||
pc = samba_popt_get_context(getprogname(),
|
||||
argc,
|
||||
(const char **)argv,
|
||||
long_options,
|
||||
0);
|
||||
if (pc == NULL) {
|
||||
ret = false;
|
||||
goto done;
|
||||
}
|
||||
|
||||
while(poptGetNextOpt(pc) != -1) { }
|
||||
|
||||
poptFreeContext(pc);
|
||||
|
||||
ret = lp_load_global(get_dyn_CONFIGFILE());
|
||||
if (!ret) {
|
||||
printf("failure: error loading the configuration\n");
|
||||
goto done;
|
||||
}
|
||||
|
||||
ret = torture_smbconf();
|
||||
|
||||
done:
|
||||
|
@ -1250,7 +1250,7 @@ bld.SAMBA3_BINARY('smbconftort',
|
||||
deps='''
|
||||
talloc
|
||||
smbconf
|
||||
popt_samba3
|
||||
CMDLINE_S3
|
||||
''',
|
||||
for_selftest=True)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user