File: D:/Python311/Lib/site-packages/pip/_internal/cli/__pycache__/autocompletion.cpython-311.pyc
�
�mi � � � d Z ddlmZ ddlZddlZddlZddlmZ ddlm Z ddl
mZ ddlm
Z
ddlmZmZ dd lmZ dd�Zdd�Zdd�ZdS )zALogic that powers autocompletion installed by ``pip completion``.� )�annotationsN)�Iterable)�chain)�Any)�create_main_parser)�
commands_dict�create_command)�get_default_environment�return�Nonec � ������ dt j vrdS t j � d� � rt j � d� � sdS t j d � � � dd� �t t j d � � } �| dz
�n# t
$ r d�Y nw xY wt
� � }t t � � }g }d}�D ]
}||v r|} n�|��\|dk rt j
d� � �� d� � o|d v }|rot � � }��
� � ���fd
�|� d�� � D � � }|r(|D ]} t | � � �t j
d� � �� d� � o|d
k }
|
r6t! �d� � D ]}t |� � �t j
d� � t# |� � }|j j D ]5��j t* j k r|�fd��j �j z D � � z
}�6d� �d| dz
� D � � ��fd�|D � � }�fd�|D � � }t3 �| |j j � � }
|
rt! �|
� � }d� |D � � }|D ]:}|d }|d r|d dd� dk r|dz
}t |� � �;t5 �fd�|� � � D � � � � s;|� � � D ]&}|� �� � rt |� � �'n�d� |j D � � }|� |j � � t? j |� � }�� d� � r-|D ])��j t* j k r|�j �j z z
}�*n0t3 �| |� � }
|
rt t! �|
� � � � }t d�! �fd�|D � � � � � � t j
d� � dS )z:Entry Point for completion of main and subcommand options.�PIP_AUTO_COMPLETEN�
COMP_WORDS�
COMP_CWORD� � �help�-)�show� uninstallc �t �� g | ]4}|j � �� � �|j �d d� v�-|j ��5S )r N)�canonical_name�
startswith)�.0�dist�cwords�lcs ���BD:\Python311\Lib\site-packages\pip/_internal/cli/autocompletion.py�
<listcomp>z autocomplete.<locals>.<listcomp>8 s] �� � � � ���&�1�1�"�5�5�� �'�v�a�b�b�z�9� ��#�� � � T)�
local_only�install�pathc �"