Better usage message. Ability to take args.

This commit is contained in:
dp%netscape.com 2001-11-09 19:16:04 +00:00
parent e2ceae0e2f
commit 0d257cc179

View File

@ -28,17 +28,21 @@ use Cwd;
sub PrintUsage {
die <<END_USAGE
usage: startup-unix.pl <exe>
usage: startup-unix.pl <exe> [<args>]
e.g
startup-unix.pl ../../../dist/bin/mozilla
startup-unix.pl ../../../dist/bin/mozilla -P \"Default User\"
END_USAGE
}
{
PrintUsage() if $#ARGV != 0;
PrintUsage() unless $#ARGV >= 0;
# Build up command string.
my $cwd = Cwd::getcwd();
my $cmd = join(' ', map {/\s/ ? qq("$_") : $_} @ARGV);
my $time = Time::PossiblyHiRes::getTime();
my $cmd = "@ARGV[0] \"file:$cwd/startup-test.html?begin=" . $time . "\"";
$cmd .= qq( -url "file:$cwd/startup-test.html?begin=$time");
print "cmd = $cmd\n";
# Run the command.