From: Quanah Gibson-Mount Date: Mon, 3 Jan 2011 20:01:43 +0000 (+0000) Subject: cleanup option parsing X-Git-Tag: OPENLDAP_REL_ENG_2_4_24~203 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=414f37f8663b3d01f28ac10b10ea6e2ce686fe4b;p=openldap cleanup option parsing --- diff --git a/servers/slapd/slapcommon.c b/servers/slapd/slapcommon.c index f4e2eff51c..3a39c7de73 100644 --- a/servers/slapd/slapcommon.c +++ b/servers/slapd/slapcommon.c @@ -108,7 +108,7 @@ usage( int tool, const char *progname ) } static int -parse_slapopt( void ) +parse_slapopt( int tool, int *mode ) { size_t len = 0; char *p; @@ -420,7 +420,7 @@ slap_tool_init( break; case 'o': - if ( parse_slapopt() ) { + if ( parse_slapopt( tool, &mode ) ) { usage( tool, progname ); } break; @@ -453,11 +453,20 @@ slap_tool_init( } break; - case 's': /* dump subtree */ - if ( tool == SLAPADD ) + case 's': + switch ( tool ) { + case SLAPADD: + case SLAPMODIFY: + /* no schema check */ mode |= SLAP_TOOL_NO_SCHEMA_CHECK; - else if ( tool == SLAPCAT || tool == SLAPSCHEMA ) + break; + + case SLAPCAT: + case SLAPSCHEMA: + /* dump subtree */ subtree = ch_strdup( optarg ); + break; + } break; case 't': /* turn on truncate */