Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function(context, args) // tgt:#s.ex_corp.entryway, verb:"", opt:""
- {
- var h = 'usage: reap {tgt:#s.ex_corp.entryway, verb:"get", opt:"blog"}';
- if(!args) {
- return {ok: false,msg: h};
- }
- var l = #s.scripts.lib();
- var r = /' -- (\w*) when|(\w*) of project/gim
- var matches = [];
- var match = [];
- if(args.tgt && args.verb && args.opt) {
- var ret = args.tgt.call({[args.verb]:args.opt});
- while ((match = r.exec(ret)) != null) {
- var re = match[1] || match[2];
- if(re === null) {
- match = [];
- continue;
- }
- matches.push(re);
- match = [];
- }
- return {ok: true, msg:matches};
- }else{
- return {ok: false,msg:h};
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement