|
Server : Apache System : Linux cvar2.toservers.com 3.10.0-962.3.2.lve1.5.73.el7.x86_64 #1 SMP Wed Aug 24 21:31:23 UTC 2022 x86_64 User : njnconst ( 1116) PHP Version : 8.4.18 Disable Function : NONE Directory : /usr/lib/python2.7/site-packages/click/ |
Upload File : |
�
./�_c @ s� d Z d d l Z d d l m Z d d l m Z d d l m Z d d l m Z d d l m Z d � Z d
� Z
d � Z d � Z d
� Z
d e f d � � YZ d e f d � � YZ d e f d � � YZ d e f d � � YZ d S( s;
This module started out as largely a copy paste from the stdlib's
optparse module with the features removed that we do not need from
optparse because we implement them in Click on a higher level (for
instance type handling, help formatting and a lot more).
The plan is to remove more and more from here over time.
The reason this is a different module and not optparse from the stdlib
is that there are differences in 2.x and 3.x about the error messages
generated and optparse in the stdlib uses gettext for no good reason
and might cause us issues.
Click uses parts of optparse written by Gregory P. Ward and maintained
by the Python Software Foundation. This is limited to code in parser.py.
Copyright 2001-2006 Gregory P. Ward. All rights reserved.
Copyright 2002-2006 Python Software Foundation. All rights reserved.
i����N( t dequei ( t BadArgumentUsage( t BadOptionUsage( t NoSuchOption( t
UsageErrorc sh t | � } t | � } g } d � � f d � } x� | r| | � } | d k rj | j | | � � q6 | d k r� g t | � D] } | | � ^ q� } � d k r� | j � n | j t | � � q6 | d k r6 � d k r� t d � � n t | � � | j d � q6 q6 W� d k rRt | � | � <g } t | � d � | � d )n t | � t | � f S( s� Given an iterable of arguments and an iterable of nargs specifications,
it returns a tuple with all the unpacked arguments at the first index
and all remaining arguments as the second.
The nargs specification is the number of arguments that should be consumed
or `-1` to indicate that this position should eat up all the remainders.
Missing items are filled with `None`.
c s= y$ � d k r | j � S| j � SWn t k
r8 d SXd S( N( t Nonet popleftt popt
IndexError( t c( t spos( s- /tmp/pip-install-sTXtzD/click/click/parser.pyt _fetch- s
i i s Cannot have two nargs < 0N(
R R t appendt ranget reverset tuplet TypeErrort lent reversedt list( t argst
nargs_spect rvR t nargst _t x( ( R
s- /tmp/pip-install-sTXtzD/click/click/parser.pyt _unpack_args s0
%
c C sF | d k r'