From 7f8a32572e1ee7cf96c1a65bf0eddb0f2f9b3769 Mon Sep 17 00:00:00 2001 From: Ted Kremenek Date: Wed, 2 Apr 2008 18:42:49 +0000 Subject: [PATCH] Initial work on CSS in generated index.html. Added "-V/--view" option to view index.html after it has been generated. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49108 91177308-0d34-0410-b5e6-96231b3b80d8 --- utils/scan-build | 40 ++++++++++++++++++++++++++++++++++++++-- 1 file changed, 38 insertions(+), 2 deletions(-) diff --git a/utils/scan-build b/utils/scan-build index 1f8aefbd88..5df7affd50 100755 --- a/utils/scan-build +++ b/utils/scan-build @@ -181,8 +181,25 @@ sub Postprocess { print OUT < + \n + + + + ENDTEXT for my $row ( sort { $a->[1] cmp $b->[1] } @Index ) { @@ -196,9 +213,12 @@ ENDTEXT for my $j ( 2 .. $#{$row} ) { print OUT "\n" } + + # Emit the "View" link. + + print OUT " \n"; -# print OUT "\n"; - print OUT "\n"; + # End the row. print OUT "\n"; } @@ -259,6 +279,9 @@ OPTIONS: -v - Verbose output from $Prog and the analyzer. A second "-v" increases verbosity. + -V - View analysis results in a web browser when the build + --view completes. + BUILD OPTIONS You can specify any build option acceptable to the build command. @@ -281,6 +304,7 @@ ENDTEXT my $HtmlDir; # Parent directory to store HTML files. my $IgnoreErrors = 0; # Ignore build errors. +my $ViewResults = 0; # View results when the build terminates. if (!@ARGV) { DisplayHelp(); @@ -321,6 +345,12 @@ while (@ARGV) { next; } + if ($arg eq "-V" or $arg eq "--view") { + shift @ARGV; + $ViewResults = 1; + next; + } + die "$Prog: unrecognized option '$arg'\n" if ($arg =~ /^-/); last; @@ -366,3 +396,9 @@ RunBuildCommand(\@ARGV, $IgnoreErrors); # Postprocess the HTML directory. Postprocess($HtmlDir); + +if ($ViewResults and -r "$HtmlDir/index.html") { + # Only works on Mac OS X (for now). + print "Viewing analysis results: '$HtmlDir/index.html'\n"; + `open $HtmlDir/index.html` +} -- 2.40.0
Bug Type
$row->[$j]ViewView