Permalink
Browse files

Exit is nicer than an empty die for GetOptions

  • Loading branch information...
1 parent 3300140 commit da0b6717f220905cd1a8e099a14b8190f24154ad Daniel Freedman committed Jul 6, 2010
Showing with 5 additions and 2 deletions.
  1. +5 −2 jodoc
View
7 jodoc
@@ -16,13 +16,16 @@ my %h1s = ();
my %processed = ();
my %files_to_h1s = ();
-GetOptions(
+my $result = GetOptions(
"markdown|m=s" => \$markdown_bin,
"output|o=s" => \$outputdir,
"title|t=s" => \$title,
"toc=s" => \$toc,
"template=s" => \$template
-) or die;
+);
+
+# Exit nicer than an empty die
+exit(-1) unless ($result);
die "You need to specify --output or -o if you use --toc.\n"
if ( $toc && !defined($outputdir) );

0 comments on commit da0b671

Please sign in to comment.