관리-도구
편집 파일: autocompletion.cpython-38.pyc
U &?�f� � @ s� d Z ddlZddlZddlZddlmZ ddlmZmZm Z m Z ddlmZ ddl mZmZ ddlmZ dd�d d �Ze e eee e e d�dd �Zeeee d�dd�ZdS )zBLogic that powers autocompletion installed by ``pip completion``. � N)�chain)�Any�Iterable�List�Optional)�create_main_parser)� commands_dict�create_command)�get_default_environment)�returnc s dt jkrdS t j�d�r&t j�d�s*dS t jd �� dd� �tt jd �} z�| d � W n tk rv d� Y nX t� }tt�}g }d}�D ]}||kr�|} q�q�|dk �rb|dkr�t � d� � �d� o�|d k}|�r,t� }� � � ���fd d�|jdd �D �}|�r,|D ]} t| � �qt � d� � �d� �o@|dk} | �rlt� d�D ]}t|� �qRt � d� t|�}|jjD ]2��jtjk�r||�fdd��j�j D �7 }�q|dd� �d| d � D ���fdd�|D �}� fdd�|D �}t�| |jj�} | �rt� | �}dd� |D �}|D ]>}|d }|d �rT|d dd� dk�rT|d7 }t|� �q n�dd� |jD �}|�|j� t�|�}� �d��r�|D ]$��jtjk�r�|�j�j 7 }�q�n t�| |�} | �r�tt� | ��}td�� fdd�|D ��� t � d� dS )z:Entry Point for completion of main and subcommand options.�PIP_AUTO_COMPLETEN� COMP_WORDS� COMP_CWORD� � �help�-)�show� uninstallc s0 g | ](}|j ���r|j � d d� kr|j �qS )r N)�canonical_name� startswith)�.0�dist)�cwords�lc� �N/opt/hc_python/lib/python3.8/site-packages/pip/_internal/cli/autocompletion.py� <listcomp>6 s �z autocomplete.<locals>.<listcomp>T)� local_only�install�pathc s g | ]}|� j f�qS r )�nargs)r �opt_str)�optr r r N s c S s g | ]}|� d �d �qS )�=r )�split�r �xr r r r S s c s g | ]\}}|� kr||f�qS r r )r r'