From 13d6add75051c39fb399d4256b016dad4161bc1c Mon Sep 17 00:00:00 2001 From: Elijah Perrault Date: Tue, 25 Jan 2011 14:20:23 -0700 Subject: [PATCH] Added -h/--help and moved the argument iterator. --- install | 31 ++++++++++++++++++------------- 1 file changed, 18 insertions(+), 13 deletions(-) diff --git a/install b/install index d37952d..39aac2e 100755 --- a/install +++ b/install @@ -48,6 +48,24 @@ sub modfind return 1; } +# Iterate through the arguments passed to us. +my $features = "base"; +if (defined $ARGV[0]) { + foreach (@ARGV) { + if ($_ eq "-h" or $_ eq "--help") { + println "*** ./install help ***"; + println " --enable-sasl - Enable support for SASL."; + println "*** End of Help ***"; + exit; + } + elsif ($_ eq "--enable-sasl") { + $features .= " sasl"; + } + else { + println "Warning: Unknown option '".$_."'"; + } + } +} # Check operating system. print "Checking operating system..... $OSNAME - "; @@ -77,19 +95,6 @@ elsif ($OSNAME eq "openbsd") { } else { print "Unknown operating system. Contact support.\r\n"; -} - -# Iterate through the arguments passed to us. -my $features = "base"; -if (defined $ARGV[0]) { - foreach (@ARGV) { - if ($_ eq "--enable-sasl") { - $features .= " sasl"; - } - else { - println "Warning: Unknown option '".$_."'"; - } - } } # Check Perl version.