equal
deleted
inserted
replaced
78 os.exit(1); |
78 os.exit(1); |
79 end |
79 end |
80 |
80 |
81 if arg[1] then |
81 if arg[1] then |
82 if arg[2] then |
82 if arg[2] then |
83 -- prosodyctl shell module reload foo bar.com --> module:reload("foo", "bar.com") |
83 local fmt = { "%s"; ":%s("; ")" }; |
84 arg[1] = string.format("%s:%s("..string.rep("%q", #arg-2,", ")..")", unpack(arg)); |
84 for i = 3, #arg do |
|
85 if arg[i]:sub(1, 1) == ":" then |
|
86 table.insert(fmt, i, ")%s("); |
|
87 elseif i > 3 and fmt[i - 1] == "%q" then |
|
88 table.insert(fmt, i, ", %q"); |
|
89 else |
|
90 table.insert(fmt, i, "%q"); |
|
91 end |
|
92 end |
|
93 arg[1] = string.format(table.concat(fmt), table.unpack(arg)); |
85 end |
94 end |
86 |
95 |
87 client.events.add_handler("connected", function() |
96 client.events.add_handler("connected", function() |
88 send_line(client, arg[1]); |
97 send_line(client, arg[1]); |
89 return true; |
98 return true; |