aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2022-01-09 15:19:55 +0100
committerKim Alvefur <zash@zash.se>2022-01-09 15:19:55 +0100
commit6852806c10e766fc982789c8badfef967dac466d (patch)
treea493fc1321a9b5474855896e8b9d9be1cac5bbe1
parent552af220f49fffc964532305a05148e2362297e1 (diff)
downloadprosody-6852806c10e766fc982789c8badfef967dac466d.tar.gz
prosody-6852806c10e766fc982789c8badfef967dac466d.zip
migrator: Customise cli argument parsing (--help, --verbose)
Previously -v etc would do nothing and --config without argument would not have worked correctly.
-rw-r--r--tools/migration/prosody-migrator.lua9
1 files changed, 8 insertions, 1 deletions
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();