urbit/pkg/arvo/mar/lens/command.hoon

65 lines
1.4 KiB
Plaintext
Raw Normal View History

2016-02-27 04:13:00 +03:00
/- lens
|_ com/command:lens
2016-02-27 04:13:00 +03:00
++ grab
|%
++ noun command:lens
2016-02-27 04:13:00 +03:00
++ json
|= jon/^json
^- command:lens
2016-05-04 02:26:52 +03:00
~| jon=jon
2016-02-27 04:13:00 +03:00
%- need
%. jon
=< %- ot :~
2016-03-09 04:19:28 +03:00
source+source
sink+sink
2016-02-27 04:13:00 +03:00
==
=, dejs-soft:format
2016-02-27 04:13:00 +03:00
|%
++ source
2019-01-02 22:24:28 +03:00
^- $-(^^json (unit source:lens))
|= jon/^^json
2016-03-12 03:37:11 +03:00
=+ tuple=%.(jon (ar source))
?^ tuple
`[%tuple u.tuple]
2016-03-09 04:19:28 +03:00
%. jon
2016-02-27 04:13:00 +03:00
%- of :~
data+so
dojo+so
clay+so
url+(su auri:de-purl:html)
2016-02-27 04:13:00 +03:00
api+(su ;~(plug sym ;~(pfix col prn)))
2016-03-08 01:06:17 +03:00
:- %get-api
%- su
;~ plug
sym
;~(pfix col (more net (cook crip (star ;~(less net prn)))))
2016-03-08 01:06:17 +03:00
==
2016-02-27 04:13:00 +03:00
listen-api+(su ;~(plug sym ;~(pfix col sym)))
export+so
2019-07-16 23:52:42 +03:00
import+(ot app+so base64-jam+so ~)
2016-03-09 04:19:28 +03:00
as+(ot mark+(su sym) next+source ~)
hoon+(ot code+so next+source ~)
2016-02-27 04:13:00 +03:00
==
++ none |=(^^json (some ~))
2016-02-27 04:13:00 +03:00
++ sink
2019-01-02 22:24:28 +03:00
^- $-(^^json (unit sink:lens))
2016-02-27 04:13:00 +03:00
%- of :~
stdout+none
output-file+so
output-pill+so
2016-02-27 04:13:00 +03:00
output-clay+(su (easy /sentinel/path))
url+(su auri:de-purl:html)
2016-02-27 04:13:00 +03:00
to-api+(su ;~(plug sym ;~(pfix col prn)))
2016-03-09 04:19:28 +03:00
:- %send-api
%- su
;~ plug
sym
;~(pfix col (more net (cook crip (star ;~(less net prn)))))
2016-03-09 04:19:28 +03:00
==
command+so
2016-02-27 04:13:00 +03:00
app+(su sym)
==
--
--
--