chiark / gitweb /
where-vessels: fix bugs due to split code and abbrev
authorIan Jackson <ian@liberator.relativity.greenend.org.uk>
Sun, 13 Dec 2009 13:07:38 +0000 (13:07 +0000)
committerIan Jackson <ian@liberator.relativity.greenend.org.uk>
Sun, 13 Dec 2009 13:07:38 +0000 (13:07 +0000)
yarrg/where-vessels

index 712991098295b4b93e6a7f879f85d0c8dd2c28e9..9ec3b35fc8ee8b139abcd94286672cce43df76af 100755 (executable)
@@ -188,9 +188,9 @@ proc parse-notes {} {
     }
 }
 
-proc note-info {lno vid name description} {
+proc note-info {lno vid name island description} {
     global note_infos
-    lappend note_infos [list $lno $vid $name $description]
+    lappend note_infos [list $lno $vid $name $island $description]
 }
 
 proc display-note-infos {} {
@@ -210,15 +210,17 @@ proc display-note-infos {} {
     set infodata {}
 
     foreach info $note_infos {
-       manyset $info lno vid name description
+       manyset $info lno vid name island description
        append infodata "vessel"
        append infodata " $vid"
        if {[string length $name]} { append infodata " $name" }
+       if {[string length $island]} { append infodata " ($island)" }
        append infodata ": " $description "\n"
     }
 
     if {$nmissing} {
-       append infodata "$nmissing vessels not mentioned in notes:\n"
+       if {[string length $infodata]} { append infodata "\n" }
+       append infodata "$nmissing vessel(s) not mentioned in notes:\n"
        set last_island {}
        foreach info [lsort $note_missings] {
            manyset $info island name vid
@@ -233,8 +235,8 @@ proc display-note-infos {} {
     parser-control-failed-core .ctrl.notes notes \
        white blue 0 \
        $tiny \
-       "[llength $note_infos] warnings;\
-         $nmissing vessels missing" \
+       "[llength $note_infos] warning(s);\
+         $nmissing vessel(s) missing" \
        "Full description of warnings and missing vessels:" \
        $infodata
 }
@@ -320,7 +322,7 @@ proc vessel {vin} {
        manyset $note lno notename owner xabbrev
        if {[string compare -nocase $realname $notename]} {
            note-info $lno $vid $realname $island \
-               "notes say name is $notename - perhaps renamed"
+               "notes say name is $notename"
        }
        if {[string length $owner]} {
            if {![string compare $owner $pirate]} {