diff options
-rw-r--r-- | ChangeLog | 11 | ||||
-rw-r--r-- | bin/MakeProjectCreator/modules/Driver.pm | 24 |
2 files changed, 32 insertions, 3 deletions
diff --git a/ChangeLog b/ChangeLog index 194dc59cf21..cd2c2502afa 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +Thu Mar 6 08:06:35 2003 Chad Elliott <elliott_c@ociweb.com> + + * bin/MakeProjectCreator/modules/Driver.pm: + + Added an environment variable that allows users to set default + command line parameters. The MPC_COMMANDLINE environment variable + is added to the command line parameters. It will not override any + arguments passed in. + Wed Mar 5 21:45:39 2003 Steve Huston <shuston@riverace.com> * ace/INET_Addr.cpp (get_port_number_from_name): Correct arg name @@ -26,7 +35,7 @@ Wed Mar 5 06:32:40 2003 Phil Mesnier <mesnier_p@ociweb.com> Wed Mar 5 06:10:48 2003 Phil Mesnier <mesnier_p@ociweb.com> - * ace/Makefile.bor: + * ace/Makefile.bor: Added codeset registry files to makefile. diff --git a/bin/MakeProjectCreator/modules/Driver.pm b/bin/MakeProjectCreator/modules/Driver.pm index 79d0063ebe4..33741a8c038 100644 --- a/bin/MakeProjectCreator/modules/Driver.pm +++ b/bin/MakeProjectCreator/modules/Driver.pm @@ -13,12 +13,15 @@ package Driver; use strict; use File::Basename; +use Parser; + # ************************************************************ # Data Section # ************************************************************ my($index) = 0; my(@progress) = ("|", "/", "-", "\\"); +my($cmdenv) = 'MPC_COMMANDLINE'; # ************************************************************ # Subroutine Section @@ -168,6 +171,14 @@ sub run { $self->{'types'}->{$tag} = $creator; } + ## Before we process the arguments, we will prepend the $cmdenv + ## environment variable. + if (defined $ENV{$cmdenv}) { + my($envargs) = Parser::create_array(undef, $ENV{$cmdenv}); + unshift(@args, @$envargs); + } + + ## Process the command line arguments for(my $i = 0; $i <= $#args; $i++) { my($arg) = $args[$i]; if ($arg eq '-complete') { @@ -182,8 +193,17 @@ sub run { my($type) = lc($args[$i]); if (defined $self->{'types'}->{$type}) { - my($call) = $self->{'types'}->{$type}; - push(@generators, $call); + my($call) = $self->{'types'}->{$type}; + my($found) = 0; + foreach my $generator (@generators) { + if ($generator eq $call) { + $found = 1; + last; + } + } + if (!$found) { + push(@generators, $call); + } } else { $self->usageAndExit("Invalid type: $args[$i]"); |