From 9b3a3d5fce5acdafc99d861b25b2cc8d1ae75519 Mon Sep 17 00:00:00 2001 From: Pierangelo Masarati Date: Fri, 16 Apr 2004 18:54:15 +0000 Subject: [PATCH] improve tool mode selection by slapd switch --- doc/man/man8/slapd.8 | 2 +- servers/slapd/main.c | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/doc/man/man8/slapd.8 b/doc/man/man8/slapd.8 index 839d830c60..096b12eff5 100644 --- a/doc/man/man8/slapd.8 +++ b/doc/man/man8/slapd.8 @@ -7,7 +7,7 @@ slapd \- Stand-alone LDAP Daemon .SH SYNOPSIS .B LIBEXECDIR/slapd .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 [\-f slapd\-config\-file] .B [\-h URLs] diff --git a/servers/slapd/main.c b/servers/slapd/main.c index bbb4374da1..a09c61dc17 100644 --- a/servers/slapd/main.c +++ b/servers/slapd/main.c @@ -133,7 +133,8 @@ usage( char *name ) fprintf( stderr, "\t-4\t\tIPv4 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-d level\tDebug level" "\n" "\t-f filename\tConfiguration file\n" @@ -387,7 +388,7 @@ int main( int argc, char **argv ) case 'T': 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); MAIN_RETURN(rc); }