�
��^i6
� � � d Z ddlZddlZddlmZmZ ddlmZ ddlm Z m
Z
ddlmZm
Z
ddlmZ ddlmZmZ d d
gZde fd�Zd
ee deeee f fd�ZdS )z=A single place for constructing and exposing the main parser
� N)�List�Tuple)�
cmdoptions)�ConfigOptionParser�UpdatingDefaultsHelpFormatter)�
commands_dict�get_similar_commands)�CommandError)�get_pip_version�get_prog�create_main_parser�
parse_command�returnc � � t ddt � � dt � � �� � } | � � � t � � | _ t
j t j | � � }| � |� � d| _
dgd� t j � � D � � z }d�
|� � | _ | S ) z1Creates and returns the main parser for pip's CLIz
%prog [options]F�global)�usage�add_help_option� formatter�name�progT� c �. � g | ]\ }}|d �d|j � ���S )�27� )�summary)�.0r �command_infos ��/builddir/build/BUILDROOT/alt-python311-pip-21.3.1-4.el8.x86_64/opt/alt/python311/lib/python3.11/site-packages/pip/_internal/cli/main_parser.py�
z&create_main_parser..' s@ � � � � ��D�,� �+�+�+�\�)�+�+�� � � �
)r r r �disable_interspersed_argsr �versionr �make_option_group�
general_group�add_option_group�mainr �items�join�description)�parser�gen_optsr* s r r
r
s� � � �+��/�1�1�
�
�Z�Z�� � �F� �$�$�&�&�&�$�&�&�F�N� �+�J�,D�f�M�M�H�
���H�%�%�%� �F�K� �$� � �"/�"5�"7�"7�� � � �K� ���;�/�/�F���Mr �argsc � � t � � }|� | � � \ }}|j r`t j � |j � � t j � t j � � t j � � |r|d dk r:t |� � dk r'|�
� � t j � � |d }|t vrSt |� � }d|� d�g}|r|�
d|� d�� � t d� |� � � � �| d d � }|� |� � ||fS )Nr �help� zunknown command "�"zmaybe you meant "z - )r
�
parse_argsr# �sys�stdout�write�os�linesep�exit�len�
print_helpr r �appendr
r) �remove)r- r+ �general_options� args_else�cmd_name�guess�msg�cmd_argss r r r 0 sT � �
�
!�
!�F� "(�!2�!2�4�!8�!8��O�Y� �� ��
�����(�(�(��
�����$�$�$���
�
�
� � ��1���/�/�C� �N�N�a�4G�4G���������
�
�
� ��|�H��}�$�$�$�X�.�.��.�8�.�.�.�/��� 5��J�J�3�5�3�3�3�4�4�4��5�:�:�c�?�?�+�+�+� �A�A�A�w�H��O�O�H�����X��r )�__doc__r6 r3 �typingr r �pip._internal.clir �pip._internal.cli.parserr r �pip._internal.commandsr r �pip._internal.exceptionsr
�pip._internal.utils.miscr r �__all__r
�strr � r r �rM s
��� �
� � � �
�
�
�
� � � � � � � � � (� (� (� (� (� (� V� V� V� V� V� V� V� V� F� F� F� F� F� F� F� F� 1� 1� 1� 1� 1� 1� >� >� >� >� >� >� >� >���
1���.� � � � �>'��S� � '�e�C��c��N�&;� '� '� '� '� '� 'r