urbit/main/app/cat/core.hook
2015-01-09 18:21:25 -08:00

30 lines
680 B
Plaintext

// /%%%/ls/subdir
// /===lib/sh-utils
!:
|_ [hid=hide ~]
++ peer ,_`.
++ poke-cat-args
%+ args-into-gate .
|= [arg=(list path)]
=- tang/(flop `(list tank)`(zing -))
%+ turn arg
|= pax=path
^- (list tank)
=+ ark=;;(arch .^(%cy pax))
?^ q.ark
:- leaf/(spud pax)
%+ turn (lore ;;(@t .^(%cx pax)))
|=(a=cord leaf/(trip a))
?- r.ark :: handle ambiguity
~
[rose/[" " `~]^~[leaf/"~" (smyt pax)]]~
[[@t ~] ~ ~]
$(pax (welp pax /[p.n.r.ark]))
*
=- [palm/[": " ``~]^-]~
:~ rose/[" " `~]^~[leaf/"*" (smyt pax)]
`tank`(subdir pax r.ark)
==
==
--