o
    hM	                     @   sD   d dl mZ d dlmZmZmZ dd ZG dd deZdd Zd	S )
    )DistutilsOptionError)edit_configoption_baseconfig_filec                 C   s8   dD ]}|| v rt |   S q|  | gkrt | S | S )z4Quote an argument for later parsing by shlex.split())"'\#)reprsplit)argc r   K/var/www/html/venv/lib/python3.10/site-packages/setuptools/command/alias.pyshquote   s   r   c                   @   sH   e Zd ZdZdZdZdgej Zejdg Zdd Z	dd	 Z
d
d ZdS )aliasz3Define a shortcut that invokes one or more commandsz0define a shortcut to invoke one or more commandsT)removerzremove (unset) the aliasr   c                 C   s   t |  d | _d | _d S )N)r   initialize_optionsargsr   selfr   r   r   r      s   

zalias.initialize_optionsc                 C   s.   t |  | jrt| jdkrtdd S d S )N   zFMust specify exactly one argument (the alias name) when using --remove)r   finalize_optionsr   lenr   r   r   r   r   r   r   !   s   
zalias.finalize_optionsc                 C   s   | j d}| js td td |D ]
}tdt|| qd S t| jdkrG| j\}| jr1d }n(||v r?tdt|| d S td|  d S | jd }dtt	| jdd  }t
| jd||ii| j d S )	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   commandr   r   r   run)   s&   
z	alias.runN)__name__
__module____qualname____doc__descriptioncommand_consumes_argumentsr   user_optionsboolean_optionsr   r   r&   r   r   r   r   r      s    r   c                 C   sZ   ||  \}}|t dkrd}n|t dkrd}n|t dkr!d}nd| }||  d | S )	Nglobalz--global-config userz--user-config local z--filename=%rr   )r   )namer   sourcer%   r   r   r   r    D   s   r    N)	distutils.errorsr   setuptools.command.setoptr   r   r   r   r   r    r   r   r   r   <module>   s
    
4