gen: rewrite +vats and add optional list of desks

This commit is contained in:
silnem2 2023-04-13 09:15:03 -06:00
parent 6a0f66b836
commit f2880ecc91

View File

@ -1,20 +1,21 @@
:: Print diagnostic information about desks.
::
:: Accepts an optional argument of a list of one or more desks, returns info
:: on all desks if no desks are specified.
::
:: Keyword arguments include =filt and =verb. =filt takes one of %running,
:: %suspended, %exists, %exists-not, or %blocking; =verb takes either & or |
::
:: If both a list of desks and a filter are provided, the output will include
:: the desks from the list that match the filter, with the exception of the
:: %blocking filter which always returns all desks that match.
::
/- *hood
:- %say
|= $: [now=@da eny=@uvJ bec=beak]
$@(~ [?(%suspended %running %blocking %nonexistent) ~])
$: verb=?
show-suspended=?
show-running=?
show-blocking=?
show-nonexistent=?
==
==
=+ :- verb
?~ +<+< +<+>+
?- -.+<+<
%suspended [& | | |]
%running [| & | |]
%blocking [| | & |]
%nonexistent [| | | &]
==
tang+((report-vats p.bec now) -)
|= [[now=@da * bec=beak] deks=$@(~ (list desk)) filt=@tas verb=_|]
?: &(=(~ deks) =(%$ filt))
:- %tang
%+ turn
~(tap in .^((set desk) %cd /(scot %p p.bec)/base/(scot %da now)))
|=(syd=desk (report-vat (report-prep p.bec now) p.bec now syd verb))
[%tang (report-vats p.bec now deks filt verb)]