util/startup.lua
changeset 12164 ac654fb19203
parent 11967 f5c6be4a3ecc
child 12247 73ecfe811526
equal deleted inserted replaced
12163:aa299551f8c6 12164:ac654fb19203
    31 		short_params = { v = "verbose", h = "help", ["?"] = "help" };
    31 		short_params = { v = "verbose", h = "help", ["?"] = "help" };
    32 		value_params = { config = true };
    32 		value_params = { config = true };
    33 	};
    33 	};
    34 }
    34 }
    35 
    35 
    36 function startup.parse_args()
    36 function startup.parse_args(profile)
    37 	local opts, err, where = parse_args(arg, arg_settigs[prosody.process_type]);
    37 	local opts, err, where = parse_args(arg, arg_settigs[profile or prosody.process_type] or profile);
    38 	if not opts then
    38 	if not opts then
    39 		if err == "param-not-found" then
    39 		if err == "param-not-found" then
    40 			print("Unknown command-line option: "..tostring(where));
    40 			print("Unknown command-line option: "..tostring(where));
    41 			if prosody.process_type == "prosody" then
    41 			if prosody.process_type == "prosody" then
    42 				print("Perhaps you meant to use prosodyctl instead?");
    42 				print("Perhaps you meant to use prosodyctl instead?");