X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~mdw/git/rocl/blobdiff_plain/161e6ada263c291ff3a49b1d9f371ca5f6a1751f..338077d07f2470684827071c1f15bbc1ee782398:/elite-cmdr diff --git a/elite-cmdr b/elite-cmdr index e534158..f574f68 100755 --- a/elite-cmdr +++ b/elite-cmdr @@ -136,6 +136,8 @@ foreach {a type} { "elite" 6400 } } credits { tenth 0 429496729.5 } + legal-status { choice 0 255 + { "clean" 0 "offender" 1 "fugitive" 50 } } cargo { int 4 255 } gal-number { int 1 8 } gal-seed { seed } @@ -238,19 +240,23 @@ for {set i 0} {$i < [llength $argv]} {incr i} { exit 1 } } - "^[a-z][a-z-]*$" { - if {![info exists attr($a)]} { - puts stderr "$argv0: no such attribute `$a'" - exit 1 - } - puts [format "%-20s %s" $a [eval \ - get/[lindex $attr($a) 0] [lrange $attr($a) 1 end] [list $a]]] - set acted 1 - } default { - if {[catch { elite-unpackcmdr cmdr [read-file $a] } err]} { - puts stderr "$argv0: couldn't read `$a': $err" - exit 1 + set n 0 + foreach aa $attrs { + if {[string match $a $aa]} { + incr n + puts [format "%-20s %s" $aa [eval \ + get/[lindex $attr($aa) 0] \ + [lrange $attr($aa) 1 end] [list $aa]]] + } + } + if {$n} { + set acted 1 + } else { + if {[catch { elite-unpackcmdr cmdr [read-file $a] } err]} { + puts stderr "$argv0: couldn't read `$a': $err" + exit 1 + } } } }