Comparison

plugins/mod_invites.lua @ 13413:992389af2372

mod_invites: Fix argument handling Not sure what the next() was supposed to do. Reject unknown --options perhaps?
author Kim Alvefur <zash@zash.se>
date Sun, 21 Jan 2024 20:08:00 +0100
parent 13412:0e96d6a29a12
child 13520:662dfff658a0
comparison
equal deleted inserted replaced
13412:0e96d6a29a12 13413:992389af2372
275 print("--reset and the other options cannot be mixed.") 275 print("--reset and the other options cannot be mixed.")
276 return 2 276 return 2
277 end 277 end
278 278
279 local earlyopts = argparse.parse(arg, { short_params = { h = "help"; ["?"] = "help" } }); 279 local earlyopts = argparse.parse(arg, { short_params = { h = "help"; ["?"] = "help" } });
280 if earlyopts.help or next(earlyopts) ~= nil then 280 if earlyopts.help or not earlyopts[1] then
281 return help(); 281 return help();
282 end 282 end
283 283
284 local sm = require "prosody.core.storagemanager"; 284 local sm = require "prosody.core.storagemanager";
285 local mm = require "prosody.core.modulemanager"; 285 local mm = require "prosody.core.modulemanager";