3 ]z @sPddlmZddlmZddlmZmZmZddZGdddeZ dd Z d S) )DistutilsOptionError)map) edit_config option_base config_filecCs8xdD]}||krt|SqW|j|gkr4t|S|S)z4Quote an argument for later parsing by shlex.split()"'\#)rrr r )reprsplit)argcr>/tmp/pip-build-8jg9gmni/setuptools/setuptools/command/alias.pyshquotes   rc@sHeZdZdZdZdZdgejZejdgZddZ d d Z d d Z d S)aliasz3Define a shortcut that invokes one or more commandsz0define a shortcut to invoke one or more commandsTremoverremove (unset) the aliascCstj|d|_d|_dS)N)rinitialize_optionsargsr)selfrrrrs zalias.initialize_optionscCs*tj||jr&t|jdkr&tddS)NzFMust specify exactly one argument (the alias name) when using --remove)rfinalize_optionsrlenrr)rrrrr#s zalias.finalize_optionscCs|jjd}|jsDtdtdx|D]}tdt||q(WdSt|jdkr|j\}|jrfd}q||krtdt||dStd|dSn$|jd}djtt |jdd}t |j d||ii|j dS) NaliaseszCommand Aliasesz---------------zsetup.py aliasrz No alias definition found for %rr ) distributionget_option_dictrprint format_aliasrrjoinrrrfilenamedry_run)rrrcommandrrrrun+s&    z alias.runN)rrr) __name__ __module__ __qualname____doc__ descriptionZcommand_consumes_argumentsr user_optionsboolean_optionsrrr&rrrrrs rcCsZ||\}}|tdkrd}n,|tdkr0d}n|tdkrBd}nd|}||d|S) Nglobalz--global-config userz--user-config localz --filename=%rr)r)namersourcer%rrrr!Fs    r!N) Zdistutils.errorsrZsetuptools.extern.six.movesrZsetuptools.command.setoptrrrrrr!rrrrs   4