Remove restriction that option arguments need to be before target arguments. Options can now be intermixed with targets.

[SVN r29232]
This commit is contained in:
Rene Rivera 2005-05-26 17:20:32 +00:00
parent 3da085194d
commit a9e2ffa6a1
2 changed files with 6 additions and 6 deletions

View File

@ -238,7 +238,7 @@ int main( int argc, char **argv, char **arg_environ )
argc--, argv++;
if( ( n = getoptions( argc, argv, "-:d:j:f:gs:t:ano:qv", optv ) ) < 0 )
if( getoptions( argc, argv, "-:d:j:f:gs:t:ano:qv", optv ) < 0 )
{
printf( "\nusage: jam [ options ] targets...\n\n" );
@ -258,8 +258,6 @@ int main( int argc, char **argv, char **arg_environ )
exit( EXITBAD );
}
argc -= n, argv += n;
/* Version info. */
if( ( s = getoptval( optv, 'v', 0 ) ) )
@ -270,6 +268,7 @@ int main( int argc, char **argv, char **arg_environ )
printf( " Copyright 2001 David Turner.\n" );
printf( " Copyright 2001-2004 David Abrahams.\n" );
printf( " Copyright 2002-2005 Rene Rivera.\n" );
printf( " Copyright 2003-2005 Vladimir Prus.\n" );
return EXITOK;
}
@ -414,9 +413,10 @@ int main( int argc, char **argv, char **arg_environ )
/* Add the targets in the command line to update list */
for ( n = 0; n < argc; ++n )
for ( n = 1; n < argc; ++n )
{
mark_target_for_updating(argv[n]);
if( argv[n][0] != '-' || ( argv[n][1] != '-' && !isalpha( argv[n][1] ) ) )
mark_target_for_updating(argv[n]);
}
/* Parse ruleset */

View File

@ -34,7 +34,7 @@ getoptions(
char *arg;
if( argv[i][0] != '-' || ( argv[i][1] != '-' && !isalpha( argv[i][1] ) ) )
break;
continue;
if( !optc-- )
{