o
    NK&h                     @   s`   d dl mZ d dlmZ d dlmZmZ deddfddZG d	d
 d
eZdeddfddZ	dS )    )ArgumentParser)get_logo)SanicHelpFormatterSanicSubParsersActionparserreturnNc                 C   s\   | j ddddd | j dddtd	d
 | j ddddd | j dddd | j dddd d S )Nz--hostz-H	localhostz*Inspector host address [default 127.0.0.1])defaulthelpz--portz-pi9  zInspector port [default 6457])r	   typer
   z--securez-s
store_truez2Whether to access the Inspector via TLS encryptionactionr
   z	--api-keyz-kzInspector authentication key)r
   z--rawz.Whether to output the raw response information)add_argumentint)r    r   F/var/www/html/venv/lib/python3.10/site-packages/sanic/cli/inspector.py_add_shared   s2   
r   c                       s   e Zd Z fddZ  ZS )InspectorSubParserc                    s:   t  j|i | t|  | jsd| _td| j | _d S )N T)super__init__r   descriptionr   )selfargskwargs	__class__r   r   r   $   s
   zInspectorSubParser.__init__)__name__
__module____qualname__r   __classcell__r   r   r   r   r   #   s    r   c                 C   s   t |  | jtdddtd}|jddtd}|jdd	d
d |jddtd |jddtd}|jdtdd |jdddtd}|jdddd d S )Nr   ap  Run one or none of the below subcommands. Using inspect without a subcommand will fetch general information about the state of the application instance.

Or, you can optionally follow inspect with a subcommand. If you have created a custom Inspector instance, then you can run custom commands. See https://sanic.dev/en/guide/deployment/inspector.html for more details.z  Subcommands)r   destr   titleparser_classreloadz&Trigger a reload of the server workers)r
   formatter_classz--zero-downtimer   zKWhether to wait for the new process to be online before terminating the oldr   shutdownz*Shutdown the application and all processesscalezScale the number of workersreplicaszNumber of workers requested)r   r
   z<custom>zRun a custom commandzkeyword arguments:
  When running a custom command, you can add keyword arguments by appending them to your command

	sanic inspect foo --one=1 --two=2)r
   r   r&   
positional*z7Add one or more non-keyword args to your custom command)nargsr
   )r   add_subparsersr   r   
add_parserr   r   r   )r   
subparsersreloaderr(   customr   r   r   make_inspector_parser,   sX   	

r2   )
argparser   sanic.application.logor   sanic.cli.baser   r   r   r   r2   r   r   r   r   <module>   s    	