improve tool mode selection by slapd switch

This commit is contained in:
Pierangelo Masarati 2004-04-16 18:54:15 +00:00
parent 35329394de
commit 9b3a3d5fce
2 changed files with 4 additions and 3 deletions

View File

@ -7,7 +7,7 @@ slapd \- Stand-alone LDAP Daemon
.SH SYNOPSIS .SH SYNOPSIS
.B LIBEXECDIR/slapd .B LIBEXECDIR/slapd
.B [\-[4|6]] .B [\-[4|6]]
.B [\-T {a|c|d|i|p|t}] .B [\-T {add|auth|cat|dn|index|passwd|test}]
.B [\-d debug\-level] .B [\-d debug\-level]
.B [\-f slapd\-config\-file] .B [\-f slapd\-config\-file]
.B [\-h URLs] .B [\-h URLs]

View File

@ -133,7 +133,8 @@ usage( char *name )
fprintf( stderr, fprintf( stderr,
"\t-4\t\tIPv4 only\n" "\t-4\t\tIPv4 only\n"
"\t-6\t\tIPv6 only\n" "\t-6\t\tIPv6 only\n"
"\t-T {acdipt}\tRun in Tool mode\n" "\t-T {add|auth|cat|dn|index|passwd|test}\n"
"\t\t\tRun in Tool mode\n"
"\t-c cookie\tSync cookie of consumer\n" "\t-c cookie\tSync cookie of consumer\n"
"\t-d level\tDebug level" "\n" "\t-d level\tDebug level" "\n"
"\t-f filename\tConfiguration file\n" "\t-f filename\tConfiguration file\n"
@ -387,7 +388,7 @@ int main( int argc, char **argv )
case 'T': case 'T':
for (i=0; tools[i].name; i++) { for (i=0; tools[i].name; i++) {
if ( optarg[0] == tools[i].name[4] ) { if ( strcmp( optarg, &tools[i].name[4] ) == 0 ) {
rc = tools[i].func(argc, argv); rc = tools[i].func(argc, argv);
MAIN_RETURN(rc); MAIN_RETURN(rc);
} }