1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-24 02:04:21 +03:00

s3:utils: Migrate profiles 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:
Andreas Schneider 2021-01-12 15:45:21 +01:00 committed by Andrew Bartlett
parent 9d9ed421b2
commit 7d6608d1f9
2 changed files with 21 additions and 7 deletions

View File

@ -21,7 +21,7 @@
#include "includes.h"
#include "system/filesys.h"
#include "popt_common.h"
#include "lib/cmdline/cmdline.h"
#include "registry/reg_objects.h"
#include "registry/regfio.h"
#include "../libcli/security/security.h"
@ -248,15 +248,29 @@ int main( int argc, const char *argv[] )
POPT_TABLEEND
};
poptContext pc;
bool ok;
smb_init_locale();
/* setup logging options */
ok = samba_cmdline_init(frame,
SAMBA_CMDLINE_CONFIG_CLIENT,
false /* require_smbconf */);
if (!ok) {
DBG_ERR("Failed to init cmdline parser!\n");
TALLOC_FREE(frame);
exit(1);
}
setup_logging( "profiles", DEBUG_STDERR);
pc = poptGetContext("profiles", argc, argv, long_options,
POPT_CONTEXT_KEEP_FIRST);
pc = samba_popt_get_context(getprogname(),
argc,
argv,
long_options,
POPT_CONTEXT_KEEP_FIRST);
if (pc == NULL) {
DBG_ERR("Failed to setup popt context!\n");
TALLOC_FREE(frame);
exit(1);
}
poptSetOtherOptionHelp(pc, "<profilefile>");

View File

@ -11,7 +11,7 @@ bld.SAMBA3_BINARY('profiles',
source='profiles.c',
deps='''
talloc
popt_samba3
CMDLINE_S3
smbconf
REGFIO''')