File: //lib/python3.9/site-packages/argcomplete/__pycache__/my_argparse.cpython-39.pyc
a
�]�; � @ sv d dl mZmZmZmZ d dl mZmZmZmZm Z d dl m
Z
mZ i Zdd� Z
dd� Zdd d
�ZG dd� de�Zd
S )� )�ArgumentParser�
ArgumentError�SUPPRESS�_SubParsersAction)�OPTIONAL�ZERO_OR_MORE�ONE_OR_MORE� REMAINDER�PARSER)�_get_action_name�_c C sv t �| d�}| jtttfv r dS | jtkr2|dkS | jtkr@dS | jdu rR|dkS t| jt �slJ d| j ��|| jkS )zt Returns False if the parse would raise an error if no more arguments are given to this action, True otherwise.
r T� FN�+failed to handle a possible nargs value: %r)
�_num_consumed_args�get�nargsr r r r r
�
isinstance�int��action�num_consumed_args� r �;/usr/lib/python3.9/site-packages/argcomplete/my_argparse.py�action_is_satisfied s
r c C sb t �| d�}| jttttfv r"dS | jtks6| jdu r>|dkS t| jt �sXJ d| j ��|| jk S )zV Returns True if action could consume more arguments (i.e., its pattern is open).
r TNr )
r r r r r r
r r r r r r r r �action_is_open s r Fc C sB t �| d�}| jr,|s"t| �s"dS | jtkS | jtko<|dkS dS )z� Returns True if action will necessarily consume the next argument.
isoptional indicates whether the argument is an optional (starts with -).
r Tr
N)r r �option_stringsr r r )r Z
isoptionalr r r r �action_is_greedy- s
r c @ s e Zd ZdZdd� ZdS )�IntrospectiveArgumentParserz� The following is a verbatim copy of ArgumentParser._parse_known_args (Python 2.7.3),
except for the lines that contain the string "Added by argcomplete".
c s� t �� �� _g � _� jd ur(� ����i � � � _� jD ]R}|j}t |j�D ]<\}}� �
|g �}|�|d |� � |�||d d � � qLq8i �g }t��} t | �D ]^\}}
|
dkr�|�
d� | D ]}
|�
d� q�q�� �|
�}|d u r�d}n|�|<