diff options
author | elliott_c <ocielliottc@users.noreply.github.com> | 2003-03-06 14:14:42 +0000 |
---|---|---|
committer | elliott_c <ocielliottc@users.noreply.github.com> | 2003-03-06 14:14:42 +0000 |
commit | cfa6ad0eac9af6236de1635327e0b3de8c5b3c02 (patch) | |
tree | 917fcc5e62ff4cbc0ab23edfa5cc189b79e62bfd /bin | |
parent | 582d0990b743ae3f11434b2337ad570102fe342b (diff) | |
download | ATCD-cfa6ad0eac9af6236de1635327e0b3de8c5b3c02.tar.gz |
ChangeLogTag: Thu Mar 6 08:06:35 2003 Chad Elliott <elliott_c@ociweb.com>
Diffstat (limited to 'bin')
-rw-r--r-- | bin/MakeProjectCreator/modules/Driver.pm | 24 |
1 files changed, 22 insertions, 2 deletions
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]"); |