1 local verse = require "verse"; |
1 local verse = require "verse"; |
2 local envload = require "util.envload".envload; |
2 local envload = require "prosody.util.envload".envload; |
3 local xml = require "util.xml"; |
3 local xml = require "prosody.util.xml"; |
4 short_opts.i = "interactive"; |
4 short_opts.i = "interactive"; |
5 short_opts.e = "echo"; |
5 short_opts.e = "echo"; |
6 |
6 |
7 return function (opts, args) |
7 return function (opts, args) |
8 if opts.short_help then |
8 if opts.short_help then |
116 end |
116 end |
117 if not opts.interactive then |
117 if not opts.interactive then |
118 conn:close(); |
118 conn:close(); |
119 end |
119 end |
120 end |
120 end |
121 stdin = require "net.server".wrapclient(stdin, "stdin", 0, { |
121 stdin = verse.server.wrapclient(stdin, "stdin", 0, { |
122 onincoming = on_incoming, ondisconnect = function () conn:close() end, onreadtimeout = function () return true; end |
122 onincoming = on_incoming, ondisconnect = function () conn:close() end, onreadtimeout = function () return true; end |
123 }, "*l"); |
123 }, "*l"); |
124 else |
124 else |
125 if not send_xml then |
125 if not send_xml then |
126 send_xml = table.concat(args, " "); |
126 send_xml = table.concat(args, " "); |