complain if "-T" is not the first option

This commit is contained in:
Pierangelo Masarati 2006-09-08 18:25:34 +00:00
parent c3f9d68027
commit d5bb38f7e5

View File

@ -369,6 +369,7 @@ int main( int argc, char **argv )
size_t l;
int slapd_pid_file_unlink = 0, slapd_args_file_unlink = 0;
int firstopt = 1;
#ifdef CSRIMALLOC
FILE *leakfile;
@ -623,6 +624,12 @@ int main( int argc, char **argv )
break;
case 'T':
if ( firstopt == 0 ) {
fprintf( stderr, "warning: \"-T %s\" "
"should be the first option.\n",
optarg );
}
/* try full option string first */
for ( i = 0; tools[i].name; i++ ) {
if ( strcmp( optarg, &tools[i].name[4] ) == 0 ) {
@ -653,6 +660,10 @@ unhandled_option:;
SERVICE_EXIT( ERROR_SERVICE_SPECIFIC_ERROR, 15 );
goto stop;
}
if ( firstopt ) {
firstopt = 0;
}
}
ber_set_option(NULL, LBER_OPT_DEBUG_LEVEL, &slap_debug);