#! /usr/bin/tclsh
#
-# $Id: elite-pairs,v 1.2 2003/02/25 00:25:38 mdw Exp $
+# $Id: elite-pairs,v 1.3 2003/02/26 00:02:51 mdw Exp $
package require "elite" "1.0.0"
set g $galaxy1
set d 70
+set v 0
for {set i 0} {$i < [llength $argv]} {incr i} {
set a [lindex $argv $i]
switch -glob -- $a {
incr i
set d [expr {[lindex $argv $i] * 10}]
}
+ "-v" {
+ incr v
+ }
+ "-q" {
+ incr v -1
+ }
"--" {
incr i
break
}
"-*" {
- puts stderr "usage: $argv0 \[-g GALAXY\] \[-d DIST\] AEXPR BEXPR"
+ puts stderr "usage: $argv0 \[-qv\] \[-g GALAXY\] \[-d DIST\] AEXPR BEXPR"
exit 1
}
default {
foreach {ss xx yy} $adj($s) {
set d [world-distance $x $y $xx $yy]
if {[ok $ss {a d} $bexpr]} {
- puts [format "%-11s %-11s (%.1f LY)" $a(name) [worldname $ss] \
- [expr {[world-distance $x $y $xx $yy]/10.0}]]
+ set d [expr {[world-distance $x $y $xx $yy]/10.0}]
+ if {$v} {
+ puts [format "%s (%.1f LY)" [world-summary $s] $d]
+ puts [world-summary $ss]
+ puts ""
+ } else {
+ puts [format "%-11s %-11s (%.1f LY)" $a(name) [worldname $ss] $d]
+ }
}
}
}