MRe @sddlZddlZddlmZddlmZddlmZddlTddlm Z m Z m Z ddZ Gd d d e Z d d ZdS) N)Command) convert_path)log)*) edit_config option_base config_filecCsJx$dD]}||krt|SqW|j|gkrFt|S|S)z4Quote an argument for later parsing by shlex.split()"'\#)r r r r )reprsplit)argcr3/tmp/pip-l4uy7dan-build/setuptools/command/alias.pyshquotes    rc@sfeZdZdZdZdZdgejZejdgZddZ 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 aliascCs#tj|d|_d|_dS)N)rinitialize_optionsargsr)selfrrrrs  zalias.initialize_optionscCs>tj||jr:t|jdkr:tdndS)NzFMust specify exactly one argument (the alias name) when using --remove)rfinalize_optionsrlenrDistutilsOptionError)rrrrr"s zalias.finalize_optionscCs"|jjd}|jsZtdtdx$|D]}tdt||q6WdSt|jdkr|j\}|jrd}q||krtdt||dStd|dSn2|jd}djtt |jdd}t |j ii||6d6|j dS) NaliaseszCommand Aliasesz---------------zsetup.py aliasrz No alias definition found for %rr ) distributionget_option_dictrprint format_aliasrrjoinmaprrfilenamedry_run)rrrcommandrrrrun*s&         %z alias.runN)zremoverr) __name__ __module__ __qualname____doc__ descriptionZcommand_consumes_argumentsr user_optionsboolean_optionsrrr*rrrrrs    rcCs{||\}}|tdkr+d}n@|tdkrFd}n%|tdkrad}n d|}||d|S) Nglobalz--global-config userz--user-config localz --filename=%rr )r)namersourcer)rrrr$Es    r$) distutilsos setuptoolsrdistutils.utilrrdistutils.errorsZsetuptools.command.setoptrrrrrr$rrrrs  4