summaryrefslogtreecommitdiff
path: root/doc/fixnavi.pl
diff options
context:
space:
mode:
authorOswald Buddenhagen <oswald.buddenhagen@nokia.com>2010-01-05 17:57:11 +0100
committerOswald Buddenhagen <oswald.buddenhagen@nokia.com>2010-01-05 18:32:32 +0100
commit48c1cc8c89a9329f384b35a677e669c3a8e47704 (patch)
tree80760d10190f7ed0a4b3d39ae61c6773d87234d9 /doc/fixnavi.pl
parent27065239a0f953c19763a07eb17fac5299c91b08 (diff)
downloadqt-creator-48c1cc8c89a9329f384b35a677e669c3a8e47704.tar.gz
better error reporting
Diffstat (limited to 'doc/fixnavi.pl')
-rwxr-xr-xdoc/fixnavi.pl11
1 files changed, 6 insertions, 5 deletions
diff --git a/doc/fixnavi.pl b/doc/fixnavi.pl
index b492ae4142..093cf08a84 100755
--- a/doc/fixnavi.pl
+++ b/doc/fixnavi.pl
@@ -2,8 +2,9 @@
use strict;
+@ARGV == 1 or die "usage: $0 <qdoc-file>\n";
my $file = $ARGV[0];
-open FILE, $file or die "File $file cannot be opened.";
+open FILE, $file or die "File $file cannot be opened.\n";
my @toc = ();
my %title2page = ();
my $doctitle = "";
@@ -17,7 +18,7 @@ while (<FILE>) {
$curpage = $1;
} elsif (/^\h*\\title\h+(.+)$/) {
if ($curpage eq "") {
- die "Title '$1' appears in no \\page\n";
+ die "Title '$1' appears in no \\page.\n";
}
$title2page{$1} = $curpage;
$doctitle = $1 if (!$doctitle);
@@ -42,8 +43,8 @@ for my $title (@toc) {
$last = $title;
}
-open IN, $file or die "File $file cannot be opened a second time?!";
-open OUT, '>'.$file.".out" or die "File $file.out cannot be created.";
+open IN, $file or die "File $file cannot be opened a second time?!\n";
+open OUT, '>'.$file.".out" or die "File $file.out cannot be created.\n";
my $cutting = 0;
while (<IN>) {
if (!$cutting) {
@@ -66,4 +67,4 @@ while (<IN>) {
close OUT;
close IN;
-rename($file.".out", $file) or die "Cannot replace $file with new version.";
+rename($file.".out", $file) or die "Cannot replace $file with new version.\n";