
    d-                    t    d dl mZ d dlZd dlmZ d dlmZ d dlmZ erd dl	m
Z
 d dlmZ  G d d	          ZdS )
    )annotationsN)TYPE_CHECKING)	CleoError)
Definition)Application)IOc                      e Zd ZU dZded<   dZdZdZdZg Z	ded<   d"dZ
ed#d            Zed$d            Zed%d            Zd"dZd&d'dZd"dZd(dZd)dZd)dZd(dZd*d+dZd,d-d!ZdS ).BaseCommandNz
str | Nonename TFz	list[str]usagesreturnNonec                2   t                      | _        d | _        d | _        d| _        i | _        |                                  t          | j                  D ]>\  }}| j	        r2|
                    | j	                  dk    r| j	         d| | j        |<   ?d S )NFr    )r   _definition_full_definition_application_ignore_validation_errors	_synopsis	configure	enumerater   r   find)selfiusages      ^/home/feoh/.local/pipx/venvs/poetry/lib/python3.11/site-packages/cleo/commands/base_command.py__init__zBaseCommand.__init__   s    %<<3704).&)+!$+.. 	8 	8HAuy 8UZZ	22a77$(I!7!7!7!7A	8 	8    Application | Nonec                    | j         S N)r   r   s    r   applicationzBaseCommand.application*   s      r   r   c                ,    | j         | j         S | j        S r"   )r   r   r#   s    r   
definitionzBaseCommand.definition.   s     ,((r   strc                (   | j         }| j         s| j        }| j        o| j                                        }| j        r| j        j        }nt          j                    d         d         }|                    | j        |r|n| d| j         |          S )N   r   )command_namecommand_full_namescript_name)helpdescriptionr   is_single_commandr   inspectstackformat)r   	help_textr0   current_scripts       r   processed_helpzBaseCommand.processed_help5   s    I	y 	)(I -W$2C2U2U2W2W 	4!.3NN$]__R03N 1nn"00TY00&   
 
 	
r   c                    d| _         d S )NT)r   r#   s    r   ignore_validation_errorsz$BaseCommand.ignore_validation_errorsJ   s    )-&&&r   r$   c                "    || _         d | _        d S r"   )r   r   )r   r$   s     r   set_applicationzBaseCommand.set_applicationM   s    ' $r   c                    dS )z1
        Configures the current command.
        N r#   s    r   r   zBaseCommand.configureR   	     	r   ior   intc                    t                      r"   )NotImplementedErrorr   r>   s     r   executezBaseCommand.executeX   s    !###r   c                    dS )z*
        Interacts with the user.
        Nr<   rB   s     r   interactzBaseCommand.interact[   r=   r   c                    d S r"   r<   rB   s     r   
initializezBaseCommand.initializea   s    r   c                (   |                                   	 |j                            | j                   n# t          $ r | j        s Y nw xY w|                     |           |                                r|                     |           |j        	                    d          r:|j        
                    d           |j                            d| j                   |j                                         |                     |          }|d}|S )Ncommandr   )merge_application_definitioninputbindr&   r   r   rG   is_interactiverE   has_argumentargumentset_argumentr   validaterC   )r   r>   status_codes      r   runzBaseCommand.rund   s   ))+++	HMM$/**** 	 	 	1  	 	 	MM"8  ++ 	80A0A)0L0L0TH!!)TY777
ll2&&Ks   6 A
A
merge_argsboolc                   | j         d S t                      | _        | j                            | j        j                   | j                            | j         j        j                   |rO| j                            | j         j        j                   | j        	                    | j        j                   d S | j                            | j        j                   d S r"   )
r   r   r   add_optionsr   optionsr&   set_arguments	argumentsadd_arguments)r   rT   s     r   rJ   z(BaseCommand.merge_application_definition~   s    $F *))$*:*BCCC))$*;*F*NOOO 	L!//0A0L0VWWW!//0@0JKKKKK!//0@0JKKKKKr   shortc                    |rdnd}|| j         vr,| j         d| j                            |           | j         |<   | j         |         S )Nr\   longr   )r   r   r&   synopsis)r   r\   keys      r   r_   zBaseCommand.synopsis   sV    *ggFdn$$%)Y"R"R1I1I%1P1P"R"RDN3~c""r   )r   r   )r   r    )r   r   )r   r'   r"   )r$   r    r   r   )r>   r   r   r?   )r>   r   r   r   )T)rT   rU   r   r   )F)r\   rU   r   r'   )__name__
__module____qualname__r   __annotations__r/   r.   enabledhiddenr   r   propertyr$   r&   r6   r8   r:   r   rC   rE   rG   rS   rJ   r_   r<   r   r   r
   r
      s        DKDGFF8 8 8 8 ! ! ! X!       X  
 
 
 X
(. . . .% % % % %
   $ $ $ $         4L L L L L# # # # # # #r   r
   )
__future__r   r1   typingr   cleo.exceptionsr   cleo.io.inputs.definitionr   cleo.applicationr   
cleo.io.ior   r
   r<   r   r   <module>rn      s    " " " " " "              % % % % % % 0 0 0 0 0 0  ,,,,,,B# B# B# B# B# B# B# B# B# B#r   