@@ -29,6 +29,7 @@ def cli():
2929 @click .option ("--client_port" , default = 5222 , help = "Client port" )
3030 @click .option ("--server_port" , default = 5269 , help = "Server port" )
3131 @click .option ("--debug" , is_flag = True , default = False , help = "Enables debug mode" )
32+ @click .option ("--timeout" , default = 600 , help = "Connection timeout" )
3233 @click .option (
3334 "--db" ,
3435 type = str ,
@@ -37,9 +38,10 @@ def cli():
3738 help = "Path for database file" ,
3839 )
3940 @click .option (
40- "--purge" , is_flag = True , help = "Restore database file to default state (empty)"
41+ "--purge" , is_flag = True , default = False , help = "Restore database file to default state (empty)"
4142 )
42- def run (host , client_port , server_port , debug , db , purge ):
43+ @click .option ("--memory" , is_flag = True , default = False , help = "Use an in-memory database" )
44+ def run (host , client_port , server_port , debug , timeout , db , purge , memory ):
4345 """Launch an XMPP server"""
4446 if check_port_in_use (client_port , host ):
4547 click .echo (f"Error: The port { client_port } is already in use." )
@@ -65,9 +67,10 @@ def run(host, client_port, server_port, debug, db, purge):
6567 host = host ,
6668 client_port = client_port ,
6769 server_port = server_port ,
68- connection_timeout = 600 ,
70+ connection_timeout = timeout ,
6971 database_path = db ,
7072 database_purge = purge ,
73+ database_in_memory = memory ,
7174 )
7275
7376 print_spade_info ()
0 commit comments