From 6852806c10e766fc982789c8badfef967dac466d Mon Sep 17 00:00:00 2001 From: Kim Alvefur Date: Sun, 9 Jan 2022 15:19:55 +0100 Subject: migrator: Customise cli argument parsing (--help, --verbose) Previously -v etc would do nothing and --config without argument would not have worked correctly. --- tools/migration/prosody-migrator.lua | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/tools/migration/prosody-migrator.lua b/tools/migration/prosody-migrator.lua index 26b9ef58..fe2adb3a 100644 --- a/tools/migration/prosody-migrator.lua +++ b/tools/migration/prosody-migrator.lua @@ -36,9 +36,16 @@ local default_config = (CFG_CONFIGDIR or ".").."/migrator.cfg.lua"; local startup = require "util.startup"; do - startup.parse_args(); + startup.parse_args({ + short_params = { v = "verbose", h = "help", ["?"] = "help" }; + value_params = { config = true }; + }); startup.init_global_state(); prosody.process_type = "migrator"; + if prosody.opts.help then + print("prosody-migrator [input] [output]") + os.exit(0); + end startup.force_console_logging(); startup.init_logging(); startup.init_gc(); -- cgit v1.2.3