
    wgL	                     F    d dl mZmZmZ d dlmZ d Z G d de      Zd Zy)    )config_fileedit_configoption_base)DistutilsOptionErrorc                 t    dD ]  }|| v st        |       c S  | j                         | gk7  rt        |       S | S )z4Quote an argument for later parsing by shlex.split())"'\#)reprsplit)argcs     ]/home/mcse/projects/flask/flask-venv/lib/python3.12/site-packages/setuptools/command/alias.pyshquoter      sC      89 yy{seCyJ    c                   n    e Zd ZdZdZdZdgej                  z   Zej                  dgz   Zd Z	d
dZ
d
d	Zy)aliasz3Define a shortcut that invokes one or more commandsz0define a shortcut to invoke one or more commandsT)removerzremove (unset) the aliasr   c                 J    t        j                  |        d | _        d | _        y )N)r   initialize_optionsargsr   selfs    r   r   zalias.initialize_options   s    &&t,	r   Nc                     t        j                  |        | j                  r$t        | j                        dk7  rt        d      y y )N   zFMust specify exactly one argument (the alias name) when using --remove)r   finalize_optionsr   lenr   r   r   s    r   r   zalias.finalize_options!   s=    $$T*;;3tyy>Q.&X  /;r   c                 8   | j                   j                  d      }| j                  s4t        d       t        d       |D ]  }t        dt	        ||              y t        | j                        dk(  rG| j                  \  }| j                  rd }ne||v rt        dt	        ||             y t        d|z         y | j                  d   }dj                  t        t        | j                  dd              }t        | j                  d||ii| j                         y )	NaliaseszCommand Aliasesz---------------zsetup.py aliasr   z No alias definition found for %rr    )distributionget_option_dictr   printformat_aliasr   r   joinmapr   r   filenamedry_run)r   r!   r   commands       r   runz	alias.run(   s    ##33I>yy#$#$  F&UG(DEF^q yyHU{{'!&UG(DE85@AIIaLEhhs7DIIabM:;GDMMIw/?#@$,,Or   )returnN)__name__
__module____qualname____doc__descriptioncommand_consumes_argumentsr   user_optionsboolean_optionsr   r   r,    r   r   r   r      sN    =DK!% 	4  !L "11XJ>O
Pr   r   c                     ||    \  }}|t        d      k(  rd}n'|t        d      k(  rd}n|t        d      k(  rd}nd|z  }|| z   dz   |z   S )	Nglobalz--global-config userz--user-config local z--filename=%rr"   )r   )namer!   sourcer+   s       r   r&   r&   C   sc    dmOFGX&&#	;v&	&!	;w'	' 6)D=3((r   N)	setuptools.command.setoptr   r   r   distutils.errorsr   r   r   r&   r6   r   r   <module>r@      s'    K K 10PK 0Pf
)r   