our $version;
sub usage_information {
- my $retval = "\n$NAME protocol v$VERSION ($DATE)\n";
- $retval .= "More information at $URL\n";
- $retval .= "\nERROR: You have not supplied all required parameters. $NAME takes these arguments:\n\n";
- $retval .= " $NAME -s <style> [-d <debuglevel>] [-v] [-h]\n\n";
- $retval .= " <style> is the execution 'style'. Call $NAME\n";
- $retval .= " without the -s parameter to get a list of possible styles.\n";
- $retval .= " -d <debuglevel> (optional) set debug level. 0 means no debugging\n";
- $retval .= " -v (optional) display version information\n";
- $retval .= " -h (optional) display this help screen\n\n";
- $retval .= "Possible styles:\n\n";
- $retval .= " ftp\n";
- $retval .= " alpha\n";
- $retval .= " distros\n";
- $retval .= "\n";
- print $retval;
- exit;
+ print "ERROR: You have not supplied all required parameters.\n\n"
+ unless $_[0];
+ print "$NAME protocol v$VERSION ($DATE)\nMore information at $URL\n";
+ print <<"END";
+
+ $NAME -s <style> [-d <debuglevel>] [-v] [-h]\n
+ <style> is the execution 'style'. Call $NAME
+ without the -s parameter to get a list of possible styles.
+ -d <debuglevel> (optional) set debug level. 0 means no debugging
+ -v (optional) display version information
+ -h (optional) display this help screen\n
+Possible styles:\n
+ ftp
+ alpha
+ distros
+
+END
+ exit ((defined $_[0] && $_[0]) ? 0 : 1);
}
sub version_information {
print 'Running with @INC:', "\n";
print " $_\n" for @INC;
print "\n";
- exit;
+ exit 0;
}
version_information() if ($version);
-usage_information() if ($help);
+usage_information(1) if ($help);
usage_information() if (($style ne 'ftp') && ($style ne 'alpha') && ($style ne 'distros'));
my $m_style = 'ftp';