@@ -9,22 +9,14 @@ def flaskrun(app, default_host="0.0.0.0", default_port="80"):
99
1010 # Set up the command-line options
1111 parser = optparse .OptionParser ()
12- msg = 'Hostname of Flask app [{}]' .format (default_host )
13- parser .add_option ("-H" , "--host" ,
14- help = msg ,
15- default = default_host )
16- msg = 'Port for Flask app [{}]' .format (default_port )
17- parser .add_option ("-P" , "--port" ,
18- help = msg ,
19- default = default_port )
20- parser .add_option ("-d" , "--debug" ,
21- action = "store_true" , dest = "debug" ,
22- help = optparse .SUPPRESS_HELP )
12+ msg = "Hostname of Flask app [{}]" .format (default_host )
13+ parser .add_option ("-H" , "--host" , help = msg , default = default_host )
14+ msg = "Port for Flask app [{}]" .format (default_port )
15+ parser .add_option ("-P" , "--port" , help = msg , default = default_port )
16+ parser .add_option (
17+ "-d" , "--debug" , action = "store_true" , dest = "debug" , help = optparse .SUPPRESS_HELP
18+ )
2319
2420 options , _ = parser .parse_args ()
2521
26- app .run (
27- debug = options .debug ,
28- host = options .host ,
29- port = int (options .port )
30- )
22+ app .run (debug = options .debug , host = options .host , port = int (options .port ))
0 commit comments