
    h                        S r SSKrSSKrSSKrSSKJr  SSKJr  \R                   V s0 s H  o R                  U _M     sn r
S
S jr " S S\R                  5      rS r\S	:X  a  \R                   " \" 5       5        ggs  sn f )zA tool to parse and pretty-print JSON5.

Usage:

    $ echo '{foo:"bar"}' | python -m json5
    {
        foo: 'bar',
    }
    $ echo '{foo:"bar"}' | python -m json5 --as-json
    {
        "foo": "bar"
    }
    N)Host)__version__c                 X   U=(       d
    [        5       n[        X5      nUR                  (       a  UR                  [        5        gUR
                  (       a  UR
                  nOFUR                  S:X  a  UR                  R                  5       nOUR                  UR                  5      nUR                  S:X  a  S Ul
        O [        UR                  5      Ul
        UR                  (       a7  SUl        SUl        [         R"                  R$                  R&                  Ul        [         R*                  " X2R,                  S9n[         R.                  " UUR                  UR                  UR                  [0        UR(                     S9nUR                  U5        g! [         a     Nf = f)Nr   -NoneTF)strict)indent
quote_keystrailing_commasquote_style)r   _parse_argsversionprintr   cmdfilestdinreadread_text_filer	   int
ValueErroras_jsonr
   r   json5
QuoteStyleALWAYS_DOUBLEvaluer   loadsr   dumpsQUOTE_STYLES)argvhostargsinpobjss         ]C:\Users\julio\OneDrive\Documentos\Trabajo\Ideas Frescas\venv\Lib\site-packages\json5/tool.pymainr&   '   s3   >46Dt"D||

;xxhh	c	jjoo!!$)),{{f	dkk*DK ||$ ++99??
++c++
.C{{??,, !1!12	A 	JJqM#  		s   F 
F)(F)c                   F   ^  \ rS rSrSrU 4S jrSS jrS rS	S jrSr	U =r
$ )
_HostedArgumentParserP   z5An argument parser that plays nicely w/ host objects.c                 2   > Xl         [        TU ]  " S0 UD6  g )N )r    super__init__)selfr    kwargs	__class__s      r%   r-   _HostedArgumentParser.__init__S   s    	"6"    c                     U(       a%  U R                  X R                  R                  5        [        R                  " U5        g N)_print_messager    stderrsysexit)r.   statusmessages      r%   r8   _HostedArgumentParser.exitW   s)    )9)9:r2   c                    U R                   R                  SU R                   3SU R                   R                  S9  U R                   R                  SU R                   R                  S9  U R	                  SSU S35        g )	Nzusage:  )endr   z    -h/--help for help
r      zerror: 
)r    r   usager6   r8   )r.   r:   s     r%   error_HostedArgumentParser.error\   sc    		'$**.BTYY=M=MN		29I9IJ		!wwir*+r2   c                 T    U R                   R                  U R                  5       US9  g )Nr?   )r    r   format_help)r.   r   s     r%   
print_help _HostedArgumentParser.print_helpa   s    		((*6r2   )r    )r   Nr4   )__name__
__module____qualname____firstlineno____doc__r-   r8   rC   rG   __static_attributes____classcell__)r0   s   @r%   r(   r(   P   s    ?#
,
7 7r2   r(   c           	      R   Sn[        U SU[        [        R                  S9nUR	                  SSSS[
         S3S	9  UR	                  S
SSSS9  UR	                  SSSSSSS9  UR	                  SSSSS9  UR	                  SSSSS9  UR	                  SSS S!S"9  UR	                  S#SSS$S9  UR	                  S%S&SS'S(9  UR	                  S)SSS*S9  UR	                  S+S,SS-S(9  UR	                  S.S/S0[        R                  5       S1S29  UR	                  S3S4S5S6S7S89  UR                  U5      $ )9Nzjson5 [options] [FILE]
r   )progrB   descriptionformatter_classz-Vz	--version
store_truezshow JSON5 library version ())actionhelpz-cSTRr   z:inline json5 string to read instead of reading from a file)metavardestrW   z	--as-jsonr   store_constTFz:output as JSON (same as --quote-keys --no-trailing-commas))rZ   rV   constdefaultrW   z--indentr	      z0amount to indent each line (default is 4 spaces))rZ   r]   rW   z--quote-keyszquote all object keys)rV   r]   rW   z--no-quote-keysstore_falser
   zBdon't quote object keys that are identifiers (this is the default))rV   rZ   rW   z--trailing-commaszUadd commas after the last item in multi-line objects and arrays (this is the default)z--no-trailing-commasr   zEdo not add commas after the last item in multi-line lists and objects)rZ   rV   rW   z--strictz@Do not allow control characters (\x00-\x1f) in strings (default)z--no-strictr   z/Allow control characters (\x00-\x1f) in stringsz--quote-stylestorealways_doublez\Controls how strings are encoded. By default they are always double-quoted ("always_double"))rV   r]   choicesrW   r   FILE?r   z`optional file to read JSON5 document from; if not specified or "-", will read from stdin instead)rY   nargsr]   rW   )	r(   rM   argparseRawDescriptionHelpFormatteradd_argumentr   r   keys
parse_args)r    r   rB   parsers       r%   r   r   e   s   &E" <<F +K=:	   I	   I   ?	   $	   !	   3	   '	   	   @	   !!#*      T""r2   __main__)NN)rM   rf   r7   r   
json5.hostr   json5.versionr   r   r   r   r&   ArgumentParserr(   r   rI   r8   )qs   0r%   <module>rq      s     
   %$)$4$45$4q
$45&R7H33 7*]#@ zHHTV C 6s   A>