summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorfukachan <fukachan>2002-04-01 14:42:57 +0000
committerfukachan <fukachan>2002-04-01 14:42:57 +0000
commit6b0ee87fe2792a9691eec68c50532cdeb237a980 (patch)
tree1e8d13f03083f56b808456e642bf01bcec19af84
parent8b3f219237764bb83472c4b02f66aba67117f684 (diff)
downloadfml8-6b0ee87fe2792a9691eec68c50532cdeb237a980.tar.gz
fml8-6b0ee87fe2792a9691eec68c50532cdeb237a980.tar.bz2
fml8-6b0ee87fe2792a9691eec68c50532cdeb237a980.zip
warn() if $ml_name not specified
-rw-r--r--fml/lib/FML/Process/Switch.pm23
1 files changed, 16 insertions, 7 deletions
diff --git a/fml/lib/FML/Process/Switch.pm b/fml/lib/FML/Process/Switch.pm
index aa4049ae..3906f0f2 100644
--- a/fml/lib/FML/Process/Switch.pm
+++ b/fml/lib/FML/Process/Switch.pm
@@ -4,7 +4,7 @@
# All rights reserved. This program is free software; you can
# redistribute it and/or modify it under the same terms as Perl itself.
#
-# $FML: Switch.pm,v 1.57 2002/03/20 03:19:59 fukachan Exp $
+# $FML: Switch.pm,v 1.58 2002/03/30 11:08:36 fukachan Exp $
#
package FML::Process::Switch;
@@ -267,11 +267,14 @@ sub _makefml_parse_argv
{
my ($myname, $main_cf) = @_;
use FML::Process::Utils;
- my $ml_home_prefix = FML::Process::Utils::__ml_home_prefix_from_main_cf($main_cf);
+ my $ml_home_prefix =
+ FML::Process::Utils::__ml_home_prefix_from_main_cf($main_cf);
# makefml specific syntax.
if (@ARGV) {
+ my @cf = ();
my ($command, $ml_name, @options) = @ARGV;
+
if ($command =~ /\-\>/) {
($command, @options) = @ARGV;
($ml_name, $command) = split('->', $command);
@@ -282,11 +285,17 @@ sub _makefml_parse_argv
}
# save $ml_home_dir value in $main_cf directly
- $main_cf->{ ml_home_dir } = File::Spec->catfile($ml_home_prefix, $ml_name);
-
- # config.cf
- my $cf = File::Spec->catfile($ml_home_prefix, $ml_name, "config.cf");
- my @cf = ($cf);
+ if (defined $ml_name) {
+ $main_cf->{ ml_home_dir } =
+ File::Spec->catfile($ml_home_prefix, $ml_name);
+ # config.cf
+ my $cf =
+ File::Spec->catfile($ml_home_prefix, $ml_name, "config.cf");
+ @cf = ($cf);
+ }
+ else {
+ warn("\$ml_name not specified");
+ }
return \@cf;
}