shrub/pkg/arvo/mar/lens/command.hoon
Jared Tobin b3901ab42f Add 'pkg/arvo/' from commit 'c20e2a185f131ff3f5d3961829bd7a3fe0f227f8'
git-subtree-dir: pkg/arvo
git-subtree-mainline: 9c8f40bf6c
git-subtree-split: c20e2a185f
2019-06-28 12:48:05 +08:00

63 lines
1.4 KiB
Plaintext

/- lens
|_ com/command:lens
++ grab
|%
++ noun command:lens
++ json
|= jon/^json
^- command:lens
~| jon=jon
%- need
%. jon
=< %- ot :~
source+source
sink+sink
==
=, dejs-soft:format
|%
++ source
^- $-(^^json (unit source:lens))
|= jon/^^json
=+ tuple=%.(jon (ar source))
?^ tuple
`[%tuple u.tuple]
%. jon
%- of :~
data+so
dojo+so
clay+so
url+(su auri:de-purl:html)
api+(su ;~(plug sym ;~(pfix col prn)))
:- %get-api
%- su
;~ plug
sym
;~(pfix col (more net (cook crip (star ;~(less net prn)))))
==
listen-api+(su ;~(plug sym ;~(pfix col sym)))
as+(ot mark+(su sym) next+source ~)
hoon+(ot code+so next+source ~)
==
++ none |=(^^json (some ~))
++ sink
^- $-(^^json (unit sink:lens))
%- of :~
stdout+none
output-file+so
output-pill+so
output-clay+(su (easy /sentinel/path))
url+(su auri:de-purl:html)
to-api+(su ;~(plug sym ;~(pfix col prn)))
:- %send-api
%- su
;~ plug
sym
;~(pfix col (more net (cook crip (star ;~(less net prn)))))
==
command+so
app+(su sym)
==
--
--
--