HEX
Server: Apache
System: Linux sg2plmcpnl492417.prod.sin2.secureserver.net 4.18.0-553.58.1.lve.el8.x86_64 #1 SMP Fri Jul 4 12:07:06 UTC 2025 x86_64
User: nyiet8349bzl (9207396)
PHP: 8.1.34
Disabled: NONE
Upload Files
File: //opt/python38/lib/python3.8/site-packages/pip/_vendor/pygments/__pycache__/cmdline.cpython-38.pyc
U

��e�\�@sLdZddlZddlZddlZddlZddlmZddlmZm	Z	ddl
mZmZm
Z
mZmZmZmZddlmZmZmZmZmZmZddlmZddlmZmZdd	lmZm Z m!Z!m"Z"m#Z#dd
l$m%Z%ddl&m'Z'm(Z(ddl)m*Z*m+Z+dd
l,m-Z-m.Z.dd�Z/dd�Z0dd�Z1dd�Z2dd�Z3dd�Z4Gdd�dej5�Z5ej6fdd�Z7dS)z�
    pygments.cmdline
    ~~~~~~~~~~~~~~~~

    Command line interface.

    :copyright: Copyright 2006-2023 by the Pygments team, see AUTHORS.
    :license: BSD, see LICENSE for details.
�N)�dedent)�__version__�	highlight)�
ClassNotFound�OptionError�docstring_headline�guess_decode�guess_decode_from_terminal�terminal_encoding�UnclosingTextIOWrapper)�get_all_lexers�get_lexer_by_name�guess_lexer�load_lexer_from_file�get_lexer_for_filename�find_lexer_class_for_filename)�	TextLexer)�LatexEmbeddedLexer�LatexFormatter)�get_all_formatters�get_formatter_by_name�load_formatter_from_file�get_formatter_for_filename�find_formatter_class)�TerminalFormatter)�Terminal256Formatter�TerminalTrueColorFormatter)�get_all_filters�find_filter_class)�get_all_styles�get_style_by_namec
Cs�i}|s|S|D]t}|��sq|�d�}|D]V}|��}z$|�dd�\}}|��}|��}Wntk
rxd||<Yq,X|||<q,q|S)N�,�=�T)�strip�split�
ValueError)Zo_strs�optsZo_strZo_argsZo_argZo_keyZo_val�r(�@/tmp/pip-unpacked-wheel-uzdrexel/pip/_vendor/pygments/cmdline.py�_parse_options!s"
r*cCsVg}|s|S|D]@}d|krB|�dd�\}}|�|t|g�f�q|�|if�q|S)N�:r#)r%�appendr*)Zf_strs�filtersZf_str�fname�foptsr(r(r)�_parse_filters6sr0c	Cs�z�|dkr0t|�}td|j�tt|j��nX|dkr^t|�}td|j�tt|j��n*|dkr�t|�}td|�tt|j��WdSttfk
r�td|t	j
d	�Yd
SXdS)N�lexerzHelp on the %s lexer:�	formatterzHelp on the %s formatter:�filterzHelp on the %s filter:rz
%s not found!��filer#)r
�print�namer�__doc__rr�AttributeErrorr&�sys�stderr)�whatr7�clsr(r(r)�_print_helpCs"r>cCs�|dkr�t�td�td�g}t�D]@\}}}}d�|�d||rXdd�|�dpZdf}|�|�q(|��|D]}td	|�qv�nB|d
k�r t�td�td�g}t�D]F}t|�}	d�|j�d|	|jr�dd�|j�dp�df}|�|�q�|��|D]}td	|��q
n�|d
k�rxt�td�td�t	�D].}
t
|
�}td|
d�tdt|���qFnV|dk�r�t�td�td�t�D].}
t|
�}td|
d�tdt|���q�dS)Nr1zLexers:z~~~~~~~z, r+z(filenames �)�z* %s
    %s %sr2zFormatters:z~~~~~~~~~~~r3zFilters:z~~~~~~~~z* z    %s�stylezStyles:)
r6r�joinr,�sortrr�aliases�	filenamesrrrr )r<�info�fullname�names�exts�_�tup�ir=�docr7r(r(r)�_print_listWsZ�

��



rNcCsddl}i}d|krDi}t�D]\}}}}|||d�||<q||d<d|kr�i}t�D]"}t|�}	|j|j|	d�||j<qV||d<d|kr�i}t�D]}
t|
�}d	t|�i||
<q�||d
<d|kr�i}t	�D]}
t
|
�}d	t|�i||
<q�||d<|�|tj
�dS)
Nrr1)rDrE�	mimetypesZlexersr2)rDrErM�
formattersr3rMr-rAZstyles)�jsonrrrrDrEr7rrrr �dumpr:�stdout)Zrequested_itemsrQ�resultrFrGrHrErOr=rMr7r(r(r)�_print_list_as_json�sH�
�
�

�
rUc&s\
�jr|��dS�jr(tdt�dS�fdd�}�jdk	�rt�}t����D]\}}|rR|�	|�qR|�
d�|�
d�|r�|�tj�dS�j
s�tdd	g�d
ddd
h�dd��jD�}t�fdd�|D��r�|�tj�dS|s�}�j
�s
|D]}t|�q�nt|�dS�j�rf|d��s8|�tj�dS�j\}}	|dk�r\|�tj�dSt||	�St�j�prg�}
�j�p�gD]B}z|�dd�\}	}Wntk
�r�d|
|<Yn
X||
|	<�q�|
�d|
�d��}
|
�d|
�d��}�j�rt�j�}|dk�r
t}t|jd�dS�j�rntjj �!�}zt"||
d�}Wnt#k
�rZt}YnXt|jd�dS�j$}�j%}|dk	�r*�j&}|�s�|�tj�dS�j'�s��j(�r�|�tj�dSz||
d
<t)|f|
�}Wn8t#k
�r}zt|tjd�WY�dSd}~XYnXt|�*|�p d��dS�j%dk	�rF|�tj�dSt+�j,�pRg�}t-�j.�}d}�j'}|�rj|�rd|k�rz\d}d}	d|k�r�|�/dd�\}}	d|	k�r�d}	|�r�|	�r�t0||	f|
�}nt0|f|
�}Wn:t#k
�r}ztd|tjd�WY�dSd}~XYnXnPzt1|f|
�}Wn>t2t#fk
�rh}ztd|tjd�WY�dSd}~XYnXd}�j(�rԈj3�r�tdtjd�dS�j(}z"t4|d ��}|�!�}W5QRXWn:t5k
�r�}ztd!|tjd�WY�dSd}~XYnX|
�st6|�\}}
|�sPzt7||f|
�}Wn�t#k
�r�}zZ�j8�rnzt"|f|
�}Wn t#k
�rjtf|
�}YnXntd|tjd�WY�dSW5d}~XYn:t2k
�r�}ztd|tjd�WY�dSd}~XYnXn|�j3�s8tjj �!�}|
�s�t9|tj�\}}
|�sPzt"|f|
�}Wn t#k
�r4tf|
�}YnXn|�sPtd"tjd�dS|D]Z\}}z|j:|f|�Wn<t#k
�r�}ztd|tjd�WY�dSd}~XYnX�qT�j;}�j&}|�r�|�rld|k�rlz\d}d}	d|k�r|�/dd�\}}	d|	k�rd}	|�r |	�r t<||	f|
�}nt<|f|
�}Wn:t#k
�rh}ztd|tjd�WY�dSd}~XYnXnPzt)|f|
�}Wn>t2t#fk
�r�}ztd|tjd�WY�dSd}~XYnX|�rd|�szt=|f|
�}Wn>t2t#fk
�r}ztd|tjd�WY�dSd}~XYnXzt4|d#�} Wn:t5k
�r`}ztd$|tjd�WY�dSd}~XYnXnX|�s�t>j?�d%d�d&k�r�t@f|
�}n*d't>j?�d(d�k�r�tAf|
�}n
tBf|
�}tjCj } |�s�|�r�|
|_DntEtjC�|_D|�	sVtjFd)k�	rV|jGd*k�	rVtH| |jDd+�} d|_DzddlImJmKmL}!WntMk
�	r@YnX|!jN| ddd,dd-�} |
�d.d�}"tO|"�dk�	r�tP|tQ��	r�|"d}#|"d}$tR|#|$|�}�j3�	s�ztT|||| �W5|�	r�| �S�XdSz~z\tjj �U�}%|%�	s�
q|
�	s�t9|%tj�d}%tT|%||| �tV| d/��	r�| �W��	q�WW�$dStXk
�
rBYW�
dSXW5|�
rV| �S�XdS)0NruWPygments version %s, (c) 2006-2023 by Georg Brandl, Matthäus Chajdas and contributors.cs t�fdd�t����D��S)Nc3s|]\}}|�kr|VqdS�Nr()�.0�k�v��optr(r)�	<genexpr>�sz5main_inner.<locals>.is_only_option.<locals>.<genexpr>)�any�vars�itemsrZ)�argnsrZr)�is_only_option�sz"main_inner.<locals>.is_only_option�LrQ�r@�-Vr1r2r3rAcSsg|]}|�d��qS)�s)�rstrip�rW�argr(r(r)�
<listcomp>�szmain_inner.<locals>.<listcomp>c3s|]}|�kVqdSrVr(rg)�
allowed_typesr(r)r\�szmain_inner.<locals>.<genexpr>�H)r1r2r3r"r#T�
inencoding�encoding�outencoding)rlr4z.pyr+zError:z5Error: -s option not usable when input file specified�rbzError: cannot read infile:z7Error: when using -s a lexer has to be selected with -l�wbzError: cannot open outfile:Z	COLORTERM)Z	truecolorZ24bitZ256�TERM)�win32�cygwin)ZTerminalZTerminal256)rmF)�convertr$�	autoreset�wrap�escapeinside�flush)Y�help�
print_help�Vr6rrb�setr^r_�add�discardr:r;rQ�mainr]rNrUrkr>r*�O�Pr%r&�get�NrrrD�C�stdin�buffer�readrr�S�a�f�l�	INPUTFILErZget_style_defsr0�F�bool�x�rsplitrr
rre�open�	Exceptionrr�gr	Z
add_filter�orr�os�environrrrrSrmr
�platformr7rZpip._vendor.colorama.initialise�_vendor�colorama�
initialise�ImportError�wrap_stream�len�
isinstancerr�closer�readline�hasattrrx�KeyboardInterrupt)&�parserr`raZarg_setrXrY�largsrhr<r7Zparsed_optsZp_opt�valuerlrnr1�inpZS_optZa_optZf_optZfmter�errZF_optsZallow_custom_lexer_formatterZ	lexername�filename�codeZinfn�infpr.r/Zoutfn�outfileZcolorama_initialiserw�left�right�liner()rjr`r)�
main_inner�s��












���

�
��

r�c@seZdZddd�ZdS)�
HelpFormatterrc�NcCsH|dkr0zt��jd}Wntk
r.YnXtj�|||||�dS)Nrc)�shutil�get_terminal_size�columnsr��argparser��__init__)�self�prog�indent_increment�max_help_position�widthr(r(r)r�s�zHelpFormatter.__init__)rcr�N)�__name__�
__module__�__qualname__r�r(r(r(r)r�sr�cCs�d}tj|dtd�}|�d�}|��}|jdddd�|jd	d
dd�|jd
dddd�|jdddd�|jddddd�|jddddd�|jdddd�|jddd d!�|�d"�}|jd#d
d$d�|jd%d
d&d�|jd'd
d(d�|jd)d*dd
d+�|�d,�}|��}|jd-d.d/d�|jd0d1d2d3d4�|jd5d6d7d�|jd8d
d9d�|jd:d;d<d=d>d?�|jd@d
dAd�|jdBdCd
dDd�|jdEdFdGd�|�|dHdI��}zt||�WStk
�r�YdJSt	k
�r�|j
�r@ttj
dK�tdLtj
dK�tdMtj
dK�tdNtj
dK�tdOtj
dK�tdLtj
dK�ttj
dK��dJdIl}	|	jt���}
|
dP��}t|
�dQk�r�|dR|
dS�dT�dJ��dHdI�7}ttj
dK�tdUtj
dK�t|tj
dK�tdVtj
dK�YdHSXdIS)Wz(
    Main command line entry point.
    z?Highlight an input file and write the result to an output file.F)�description�add_help�formatter_classzMain operationz-lZLEXERz~Specify the lexer to use.  (Query names with -L.)  If not given and -g is not present, the lexer is guessed from the filename.)�metavarryz-g�
store_truez`Guess the lexer from the file contents, or pass through as plain text if nothing can be guessed.)�actionryz-FzFILTER[:options]r,znAdd a filter to the token stream.  (Query names with -L.) Filter options are given after a colon if necessary.)r�r�ryz-fZ	FORMATTERz�Specify the formatter to use.  (Query names with -L.) If not given, the formatter is guessed from the output filename, and defaults to the terminal formatter if the output is to the terminal or an unknown file extension.z-OzOPTION=value[,OPTION=value,...]zyGive options to the lexer and formatter as a comma-separated list of key-value pairs. Example: `-O bg=light,python=cool`.z-PzOPTION=valuez�Give a single option to the lexer and formatter - with this you can pass options whose value contains commas and equal signs. Example: `-P "heading=Pygments, the Python highlighter"`.z-oZ
OUTPUTFILEz8Where to write the output.  Defaults to standard output.r��?z5Where to read the input.  Defaults to standard input.)�nargsryzOperation flagsz-vzbPrint a detailed traceback on unhandled exceptions, which is useful for debugging and bug reports.z-sa!Process lines one at a time until EOF, rather than waiting to process the entire file.  This only works for stdin, only for lexers with no line-spanning constructs, and is intended for streaming input such as you get from `tail -f`. Example usage: `tail -f sql.log | pygmentize -s -l sql`.z-xa�Allow custom lexers and formatters to be loaded from a .py file relative to the current working directory. For example, `-l ./customlexer.py -x`. By default, this option expects a file with a class named CustomLexer or CustomFormatter; you can also specify your own class name with a colon (`-l ./lexer.py:MyLexer`). Users should be very careful not to use this option with untrusted files, because it will import and run them.z--jsonz=Output as JSON. This can be only used in conjunction with -L.)ry�defaultr�z*Special modes - do not do any highlightingz-SzSTYLE -f formatterzqPrint style definitions for STYLE for a formatter given with -f. The argument given by -a is formatter dependent.z-L�*ZWHATz�List lexers, formatters, styles or filters -- give additional arguments for the thing(s) you want to list (e.g. "styles"), or omit them to list everything.)r�r�ryz-NZFILENAMEz�Guess and print out a lexer name based solely on the given filename. Does not take input or highlight anything. If no specific lexer can be determined, "text" is printed.z-CzXLike -N, but print out a lexer name based solely on a given content from standard input.z-H�storerc)�NAMEZTYPEzrPrint detailed help for the object <name> of type <type>, where <type> is one of "lexer", "formatter" or "filter".)r�r�r�ryrdzPrint the package version.z-hz--helpzPrint this help.z-aZARGzKFormatter-specific additional argument for the -S (print style sheet) mode.r#Nrr4zA*****************************************************************z3An unhandled exception occurred while highlighting.z9Please report the whole traceback to the issue tracker atz.<https://github.com/pygments/pygments/issues>.����z	
   (f%s)����
z*** Error while highlighting:z>*** If this is a bug you want to report, please rerun with -v.)r��ArgumentParserr��add_argument_group�add_mutually_exclusive_group�add_argument�
parse_argsr��BrokenPipeErrorr�rYr6r:r;�	traceback�format_exception�exc_infor$r�r%)�args�descr�Z	operationZlexersel�flagsZspecial_modes_groupZ
special_modesr`r�rF�msgr(r(r)rs,�
��������
���	�������������&�r)8r8r�r:r�r��textwraprZpip._vendor.pygmentsrrZpip._vendor.pygments.utilrrrrr	r
rZpip._vendor.pygments.lexersrr
rrrrZ#pip._vendor.pygments.lexers.specialrZ%pip._vendor.pygments.formatters.latexrrZpip._vendor.pygments.formattersrrrrrZ(pip._vendor.pygments.formatters.terminalrZ+pip._vendor.pygments.formatters.terminal256rrZpip._vendor.pygments.filtersrrZpip._vendor.pygments.stylesrr r*r0r>rNrUr�r��argvrr(r(r(r)�<module>s2
$ 
3,Q