@program NewView.muf 1 10000 d i $include $lib/alynna $def }T }cat "@view" pretty tellme lvar cmd lvar param : resolver param @ match dup int 2 < if param @ stod dup int 2 < if pop { "Could not find the program specified." }t pid kill else swap pop then then dup program? not if pop { "Target isn't a program." }t pid kill then ; : view.list var target var tmp var beginl var endl var line var switch var found param @ resolver target ! READ_WANTS_BLANKS ( Convention 1 - look for legacy docs ) target @ "_docs" getpropstr dup tmp ! "*=*-*" smatch if tmp @ "=" split swap pop "-" split toint endl ! toint beginl ! target @ beginl @ endl @ program_getlines atellme exit then ( Convention 2 - look for Alynna's convention ) target @ "_docs" getpropstr dup tmp ! "*-*" smatch if tmp @ "-" split toint endl ! toint beginl ! target @ beginl @ endl @ program_getlines atellme exit then ( Convention 3 - look for nonstandard docs ) target @ "_docs" getpropstr dup tmp ! if { "Notice: This will execute the following command as you: " tmp @ }t { "Type Y to continue and anything else to abort." tmp @ }t read "Y" smatch if me @ tmp @ force exit else { "Aborted." }t then exit then ( Convention 4, the final one - look for Sarusa's convention ) target @ 1 99999 program_getlines foreach tostr line ! pop line @ case "*\[@VIEW BEGIN\]*" smatch when 1 switch ! 1 found ! end "*\[@VIEW PAUSE\]*" smatch when { "[Press ENTER to continue]" }tell read pop end "*\[@VIEW END\]*" smatch when 0 switch ! end default pop switch @ if line @ tellme then end endcase repeat found @ not if { "Program has no docs." }t then ; : docview[ ref:target -- ] { "#" target @ int }join param ! view.list ; PUBLIC docview $libdef docview : view.set resolver var! target target @ "_docs" param @ "=" split swap pop setprop { "Documentation set to: " param @ }t ; : view.help { "@view Advance for FB6/ProtoMUCK (C) 2003 Alynna Trypnotk" " " "Syntax:" " " " @view " " Display a program's docs." " @view #set =[-|]" " Set a programs docs." " @view #help" " You're looking at it." }array atellme ; : main " " split param ! cmd ! cmd @ tolower case "#set" smatch when view.set end "#help" smatch when view.help end default pop { param @ cmd @ }cat not if view.help else cmd @ param ! view.list then end endcase ; . c q