id\\dZddlZddlZddlZddlZddlmZddlmZm Z ddl m Z m Z m Z mZmZmZmZddlmZmZmZmZmZmZddlmZddlmZmZdd lmZm Z m!Z!m"Z"m#Z#dd l$m%Z%dd l&m'Z'm(Z(dd l)m*Z*m+Z+dd l,m-Z-m.Z.dZ/dZ0dZ1dZ2dZ3dZ4Gddej5Z5ej6fdZ7dS)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 OptionErrordocstring_headline guess_decodeguess_decode_from_terminalterminal_encodingUnclosingTextIOWrapper)get_all_lexersget_lexer_by_name guess_lexerload_lexer_from_fileget_lexer_for_filenamefind_lexer_class_for_filename) TextLexer)LatexEmbeddedLexerLatexFormatter)get_all_formattersget_formatter_by_nameload_formatter_from_fileget_formatter_for_filenamefind_formatter_class)TerminalFormatter)Terminal256FormatterTerminalTrueColorFormatter)get_all_filtersfind_filter_class)get_all_stylesget_style_by_namecZi}|s|S|D]}|s|d}|D]r}|} |dd\}}|}|}|||<^#t$rd||<YowxYw|S)N,=T)stripsplit ValueError)o_strsoptso_stro_argso_argo_keyo_vals Q/opt/cloudlinux/venv/lib/python3.11/site-packages/pip/_vendor/pygments/cmdline.py_parse_optionsr1!s D   $ ${{}}  S!! $ $EKKMME $${{322 u  $U  # # #"U  # $ KsABB'&B'cg}|s|S|D]\}d|vr?|dd\}}||t|gfE||if]|S)N:r%)r'appendr1)f_strsfiltersf_strfnamefoptss r0_parse_filtersr:6sG (( %<< ;;sA..LE5 NNE>5'#:#:; < < < < NNE2; ' ' ' ' Nc< |dkrHt|}td|jztt|jn|dkrHt |}td|jztt|jnH|dkrBt |}td|ztt|jdS#ttf$r"td|ztj Yd SwxYw) NlexerzHelp on the %s lexer: formatterzHelp on the %s formatter:filterzHelp on the %s filter:rz %s not found!filer%) rprintnamer__doc__rrAttributeErrorr(sysstderr)whatrCclss r0 _print_helprJCs! 7??#D))C )CH4 5 5 5 &%% & & & & [ &t,,C -8 9 9 9 &%% & & & & X  #D))C *T1 2 2 2 &%% & & &q J ' o$3:6666qqsC$C((/DDch|dkrttdtdg}tD]T\}}}}d|dz||rdd|zdzpdf}||U||D]}td |zdS|d krttd td g}t D]m}t |} d|jdz| |jr dd|jzdzpdf}||n||D]}td |zdS|d krttdtdtD]E} t| }td| zdztdt |zFdS|dkrttdtdtD]G} t| }td| zdztdt |zFdSdS)Nr=zLexers:z~~~~~~~z, r3z (filenames )z* %s %s %sr>z Formatters:z ~~~~~~~~~~~r?zFilters:z~~~~~~~~z* z %sstylezStyles:) rBr joinr4sortrraliases filenamesrrr r!) rHinfofullnamenamesexts_tupirIdocrCs r0 _print_listr[Ws  w  i i(6(8(8   $HeT199U##C'AMDIIdOO;cAGRIC KK      + +A $) * * * * + +     m m%''  C$S))C99S[))C/cm7B 499S]#;#;;cA7HEGIC KK      + +A $) * * * * + +     j j#%% 6 6D#D))C $+# $ $ $ (/444 5 5 5 5 6 6   i i"$$ 6 6D#D))C $+# $ $ $ (/444 5 5 5 5   6 6r;c(ddl}i}d|vr&i}tD]\}}}}|||d||<||d<d|vr?i}tD])}t|} |j|j| d||j<*||d<d|vr;i}tD]%} t| }d t|i|| <&||d <d |vr;i}tD]%} t| }d t|i|| <&||d <| |tj dS) Nrr=)rQrR mimetypeslexersr>)rQrRrZ formattersr?rZr6rNstyles)jsonr rrrQrRrCrrr r!dumprFstdout) requested_itemsraresultrSrTrUrRr]rIrZrCs r0_print_list_as_jsonrfsKKK F/!!5C5E5E   1HeY  &&DNN  xo%%%''  C$S))C; ]DNN $|?""#%%  D#D))C)#..DJJ!y/!!"$$  D#D))C)#..DJJ xIIfcj!!!!!r;cT&jr|dSjrtdtzdSfd}j3t }tD]\}}|r| || d| d|r!|tj dSj stddghd &d jD}t&fd |Dr!|tj dS|s&}j s|D]}t!|nt#|dSjrk|d s!|tj dSj\}} |d vr!|tj dSt'|| St)jpg} jpgD]6} | dd\} } | | | <"#t0$rd| | <Y3wxYw| d| d} | d| d}jr9t7j}|t8}t|jddSjritjj !} tE|| }n#tF$r t8}YnwxYwt|jddSj$}j%}|Ɖj&}|s!|tj dSj'sj(r!|tj dS || d<tS|fi| }n3#tF$r&}t|tj Yd}~dSd}~wwxYwt|*|pddSj%!|tj dStWj,pg}t[j.}d}j'}|r|rd|vr} d}d} d|vr|/dd\}} d| vrd} |r| rta|| fi| }n ta|fi| }n~#tF$r'}td|tj Yd}~dSd}~wwxYw tc|fi| }n;#tdtFf$r'}td|tj Yd}~dSd}~wwxYwd}j(r_j3rtdtj dSj(} ti|d5}|!}dddn #1swxYwYn4#tj$r'}td|tj Yd}~dSd}~wwxYw| stm|\}} |s to||fi| }n1#tF$r^}j8r+ tE|fi| }n>#tF$rt9d+i| }Yn&wxYwtd|tj Yd}~dSYd}~nd}~wtd$r'}td|tj Yd}~dSd}~wwxYwnj3sptjj !}| sts|tj\}} |s+ tE|fi| }n<#tF$rt9d+i| }Yn$wxYwn|stdtj dS|D]I\}} |j:|fi|#tF$r(}td|tj Yd}~dSd}~wwxYwj;}j&}|r|rd|vr} d}d} d|vr|/dd\}} d| vrd} |r| rty|| fi| }n ty|fi| }n~#tF$r'}td|tj Yd}~dSd}~wwxYw tS|fi| }n;#tdtFf$r'}td|tj Yd}~dSd}~wwxYw|r|sJ t{|fi| }n;#tdtFf$r'}td|tj Yd}~dSd}~wwxYw ti|d} n#tj$r'}td|tj Yd}~dSd}~wwxYw|sjt|j?d dd!vr td+i| }n;d"t|j?d#dvr td+i| }n td+i| }tjCj } |s(|r| |_DnttjC|_D|sltjFd$vr^|jGd%vrUt| |jD&} d|_D ddlImJcmKcmL}!|!M| ddd'd(} n#t$rYnwxYw| d)d}"t|"dkr6t|tr!|"d}#|"d}$t|#|$|}j3sH t|||| |r| Tn#|r| TwwxYwdS tjj U}%|%snY| s ts|%tjd}%t|%||| t| d*r| W |r| TdSdS#t$rY|r| TdSdSwxYw#|r| TwwxYw),NruWPygments version %s, (c) 2006-2023 by Georg Brandl, Matthäus Chajdas and contributors.c|tfdtD S)Nc3.K|]\}}|k |VdSN).0kvopts r0 z5main_inner..is_only_option..s+GGVaa3hhqhhhhGGr;)anyvarsitems)roargnss`r0is_only_optionz"main_inner..is_only_options<GGGGtE{{'8'8':':GGGGGGGr;LrarM-V>r=rNr?r>c8g|]}|dS)s)rstrip)rlargs r0 zmain_inner..s"444SC444r;c3 K|]}|vV dSrjrk)rlr| allowed_typess r0rpzmain_inner..s(99Cs-'999999r;H)r=r>r?r$r%T inencodingencoding outencoding)rrNr@z.pyr3zError:z5Error: -s option not usable when input file specifiedrbzError: cannot read infile:z7Error: when using -s a lexer has to be selected with -lwbzError: cannot open outfile: COLORTERM) truecolor24bit256TERM)win32cygwin)Terminal Terminal256)rF)convertr& autoresetwrap escapeinsideflushrk)Yhelp print_helpVrBrrvsetrrrsadddiscardrFrGramainrqr[rfrrJr1OPr'r(getNrrrQCstdinbufferreadrrSafl INPUTFILErget_style_defsr:Fboolxrsplitrrrrzopen Exceptionr rgr add_filterorrosenvironrrrrcrr platformrCr pip._vendor.colorama.initialise_vendorcolorama initialise wrap_stream ImportErrorlen isinstancerrrclosereadlinehasattrrKeyboardInterrupt)'parserrtruarg_setrmrnlargsr|rHrC parsed_optsp_optvaluerrr=inpS_opta_optf_optfmtererrF_optsallow_custom_lexer_formatter lexernamefilenamecodeinfninfpr8r9outfnoutfilecolorama_initialiserleftrightliners' ` @r0 main_innerrsL zq w *,78 9 9 9qHHHHH w%%KK%%''  DAq  A     cj ) ) )1z  "d   AAA 44EG444 99995999 9 9    cj ) ) )1 "!Ez ' ! !C     !  & & &q w'~c""    cj ) ) )1W d 7 7 7   cj ) ) )14&&&!B//KB&& &++c1--KD%!&K   & & &!%K    & {z/J/JKKJ//-1L1LMMK w-eg66 =E emAq wi##%%  ;;;EE   EEE  emAq GE GE     cj ) ) )1 7 eo    cj ) ) )1 #(K )%??;??EE    #CJ ' ' ' '11111  e""5;B//000q w#*%%%qEGMr * *F$(==  EI ' EY,>,> )##%.%5%5c1%=%=NHd}} $KK04@@3>@@EE1JJkJJE    h#*5555qqqqq  ))CC{CC/   h#*5555qqqqq  D 2 7  Iz # # # #1 dD!! #Tyy{{ # # # # # # # # # # # # # # #    .#* E E E E11111  2+D11 D*  .tTII[II    79 +D @ @K @ @(999 ) 8 8K 8 89(Ccj999911111   h#*5555qqqqq   Wy$$&& K9$ JJ D* 1 1#D88K88  1 1 1!00K00 1 1  Kz # # # #1 u  E U , ,e , , , ,    (Ccj 1 1 1 1111111  GE GE  ' EUNN %<<%*\\#q%9%9NHd}}#KK4XtDD7BDDEE5UJJkJJE    h#*5555qqqqq  -eCC{CC/   h#*5555qqqqq  $  25HHKHH/   h#*5555qqqqq  5$''GG    /3: F F F F11111  9z~~k"--1GGG2AA[AA"*..4444,;;{;;)88K88*# ;  ;'ENN/sz::EN  OS\%888 z000(5>JJJ O I I I I I I I I I I I I*55TU6OOGG    D ??>266L <A*UN"C"CAQ"466 7  dE5' 2 2 2     q  $y'0022!J5dCIFFqID$ug6667G,,$MMOOO $    !           sH33IILL+*L+4O O7O22O7AS S=S88S= TU UUV=V1% V=1V55V=8V59V== W.W))W.X Z/"Y;* X87Y;8YY;YY;; Z/Z**Z/? \ \&%\&]  ^*^  ^,A_44 `%>`  `%) `77a/a**a/7 bb=b88b=c dc>>d$ h hhj++k Bm%% n /n n  nn'ceZdZddZdS) HelpFormatterrwNc|- tjjdz }n#t$rYnwxYwtj|||||dS)Nrw)shutilget_terminal_sizecolumnsrargparser__init__)selfprogindent_incrementmax_help_positionwidths r0rzHelpFormatter.__init__sz = 022:Q>    ''d4D(95 B B B B Bs  --)rwrN)__name__ __module__ __qualname__rrkr;r0rrs.BBBBBBr;rcd}tj|dt}|d}|}|ddd|d d d |d ddd|ddd|dddd|dddd|ddd|ddd !|d"}|d#d d$ |d%d d& |d'd d( |d)d*dd +|d,}|}|d-d.d/|d0d1d2d34|d5d6d7|d8d d9 |d:d;d?|d@d dA |dBdCd dD |dEdFdG||dHdI} t||S#t$rYdJSt$r|j rttj KtdLtj KtdMtj KtdNtj KtdOtj KtdLtj Kttj KdJdIl} | jtj} | dP} t%| dQkrA| dR| dSdTdJdHdIzz } ttj KtdUtj Kt| tj KtdVtj KYdHSwxYw)Wz( Main command line entry point. z?Highlight an input file and write the result to an output file.F) descriptionadd_helpformatter_classzMain operationz-lLEXERz~Specify the lexer to use. (Query names with -L.) If not given and -g is not present, the lexer is guessed from the filename.)metavarrz-g store_truez`Guess the lexer from the file contents, or pass through as plain text if nothing can be guessed.)actionrz-FzFILTER[:options]r4znAdd a filter to the token stream. (Query names with -L.) Filter options are given after a colon if necessary.)rrrz-f FORMATTERzSpecify 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=valuezGive 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-o OUTPUTFILEz8Where to write the output. Defaults to standard output.r?z5Where to read the input. Defaults to standard input.)nargsrzOperation 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-xaAllow 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.)rdefaultrz*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*WHATzList 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.)rrrz-NFILENAMEzGuess 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-Hstorerw)NAMETYPEzrPrint detailed help for the object of type , where is one of "lexer", "formatter" or "filter".)rrrrrxzPrint the package version.z-hz--helpzPrint this help.z-aARGzKFormatter-specific additional argument for the -S (print style sheet) mode.r%Nrr@zA*****************************************************************z3An unhandled exception occurred while highlighting.z9Please report the whole traceback to the issue tracker atz..z (f%s) z*** Error while highlighting:z>*** If this is a bug you want to report, please rerun with -v.)rArgumentParserradd_argument_groupadd_mutually_exclusive_group add_argument parse_argsrBrokenPipeErrorrrnrBrFrG tracebackformat_exceptionexc_infor&rr') argsdescr operationlexerselflagsspecial_modes_group special_modesrtr rSmsgs r0rrs MD  $5BDDDF))*:;;I5577H  gOPPP  \3444 (?@@@ k1222  7.///  nXDEEE  l GIII3 DFFF  % %&7 8 8E  \3444  \CDDD  \6777 x'/ !33466'DDFFM *  C<===  j6777  \/000 WA/?CDDD \ )+++ h| !!!$$ e%   d122h ' 'E&%((( qq  7  sz " " " " ( , , , , Gz # # # # Mz # # # # Bz # # # # ( , , , , sz " " " " )y)3<>>:2hnn t99>> <$r(.."6"6q"9"?"?"A"A!"""EE EC 3: -CJ???? c #### N:    qq1s J Q2)GQ21Q2)8rDrrFrrtextwraprpip._vendor.pygmentsrrpip._vendor.pygments.utilrrrr r r r pip._vendor.pygments.lexersr rrrrr#pip._vendor.pygments.lexers.specialr%pip._vendor.pygments.formatters.latexrrpip._vendor.pygments.formattersrrrrr(pip._vendor.pygments.formatters.terminalr+pip._vendor.pygments.formatters.terminal256rrpip._vendor.pygments.filtersrrpip._vendor.pygments.stylesr r!r1r:rJr[rfrrargvrrkr;r0r!s 77777777PPPPPPPPPPPPPPPP999999TTTTTTTTOOOOOOOOOOOOOOFFFFFFhhhhhhhhKKKKKKKKIIIIIIII*   (060606f*"*"*"XL L L ^ BBBBBH*BBBhLLLLLLr;