diff --git a/mc1322x-load.pl b/mc1322x-load.pl index f545ad89d..361e26327 100755 --- a/mc1322x-load.pl +++ b/mc1322x-load.pl @@ -18,7 +18,7 @@ GetOptions ('file=s' => \$filename, 'terminal=s' => \$term, 'verbose' => \$verbose, 'baud=s' => \$baud, - ); + ) or die 'bad options'; $| = 1; @@ -34,11 +34,12 @@ if($filename eq '') { exit; } +if (!(-e $filename)) { die "file $filename not found\n"; } +if (($second ne '') && !(-e $second)) { die "secondary file $second not found\n"; } + my $ob = Device::SerialPort->new ($term) or die "Can't start $term\n"; # next test will die at runtime unless $ob -if ($filename eq '') { die "you must specify a file with -f\n"; } - $ob->baudrate($baud); $ob->parity('none'); $ob->databits(8);