Diff

tools/migration/prosody-migrator.lua @ 12161:6e7678f6fe9a

migrator: Customise cli argument parsing (--help, --verbose) Previously -v etc would do nothing and --config without argument would not have worked correctly.
author Kim Alvefur <zash@zash.se>
date Sun, 09 Jan 2022 15:19:55 +0100
parent 11731:076ceb405b94
child 12162:b7ee14ba09c9
line wrap: on
line diff
--- a/tools/migration/prosody-migrator.lua	Sun Jan 09 15:16:09 2022 +0100
+++ b/tools/migration/prosody-migrator.lua	Sun Jan 09 15:19:55 2022 +0100
@@ -36,9 +36,16 @@
 
 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();