55
66
77def _add_shared (parser : ArgumentParser ) -> None :
8- parser .add_argument ("--host" , "-H" , default = "localhost" )
9- parser .add_argument ("--port" , "-p" , default = 6457 , type = int )
10- parser .add_argument ("--secure" , "-s" , action = "store_true" )
11- parser .add_argument ("--api-key" , "-k" )
8+ parser .add_argument (
9+ "--host" ,
10+ "-H" ,
11+ default = "localhost" ,
12+ help = "Inspector host address [default 127.0.0.1]" ,
13+ )
14+ parser .add_argument (
15+ "--port" ,
16+ "-p" ,
17+ default = 6457 ,
18+ type = int ,
19+ help = "Inspector port [default 6457]" ,
20+ )
21+ parser .add_argument (
22+ "--secure" ,
23+ "-s" ,
24+ action = "store_true" ,
25+ help = "Whether to access the Inspector via TLS encryption" ,
26+ )
27+ parser .add_argument ("--api-key" , "-k" , help = "Inspector authentication key" )
1228 parser .add_argument (
1329 "--raw" ,
1430 action = "store_true" ,
@@ -32,17 +48,25 @@ def make_inspector_parser(parser: ArgumentParser) -> None:
3248 dest = "action" ,
3349 description = (
3450 "Run one of the below subcommands. If you have created a custom "
35- "Inspector instance, then you can run custom commands.\n See ___ "
51+ "Inspector instance, then you can run custom commands. See ___ "
3652 "for more details."
3753 ),
3854 title = "Required\n ========\n Subcommands" ,
3955 parser_class = InspectorSubParser ,
4056 )
41- subparsers .add_parser (
57+ reloader = subparsers .add_parser (
4258 "reload" ,
4359 help = "Trigger a reload of the server workers" ,
4460 formatter_class = SanicHelpFormatter ,
4561 )
62+ reloader .add_argument (
63+ "--zero-downtime" ,
64+ action = "store_true" ,
65+ help = (
66+ "Whether to wait for the new process to be online before "
67+ "terminating the old"
68+ ),
69+ )
4670 subparsers .add_parser (
4771 "shutdown" ,
4872 help = "Shutdown the application and all processes" ,
@@ -53,7 +77,11 @@ def make_inspector_parser(parser: ArgumentParser) -> None:
5377 help = "Scale the number of workers" ,
5478 formatter_class = SanicHelpFormatter ,
5579 )
56- scale .add_argument ("replicas" , type = int )
80+ scale .add_argument (
81+ "replicas" ,
82+ type = int ,
83+ help = "Number of workers requested" ,
84+ )
5785
5886 custom = subparsers .add_parser (
5987 "<custom>" ,
0 commit comments