#!/usr/bin/perl
-# Copyright (C) 2005, 2006 Apple Computer, Inc. All rights reserved.
+# Copyright (C) 2005, 2006, 2007 Apple Inc. All rights reserved.
# Copyright (C) 2006 Alexey Proskuryakov (ap@nypop.com)
#
# Redistribution and use in source and binary forms, with or without
# 2. Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the distribution.
-# 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of
+# 3. Neither the name of Apple Inc. ("Apple") nor the names of
# its contributors may be used to endorse or promote products derived
# from this software without specific prior written permission.
#
use warnings;
use Cwd;
+use File::Basename;
use Getopt::Long;
use FindBin;
# Argument handling
my $httpdPort = 8000;
my $allInterfaces = 0;
+my $showHelp;
-GetOptions(
- 'port=i' => \$httpdPort,
+my $result = GetOptions(
'all-interfaces|a' => \$allInterfaces,
+ 'help|h' => \$showHelp,
+ 'port=i' => \$httpdPort,
);
+if (!$result || @ARGV || $showHelp) {
+ print "Usage: " . basename($0) . " [options]\n";
+ print " -a|--all-interfaces Bind to all interfaces\n";
+ print " -h|--help Show this help message\n";
+ print " -p|--port NNNN Bind to port NNNN\n";
+ exit 1;
+}
+
setConfiguration();
my $productDir = productDir();
chdirWebKit();