B
    ›³ëbV©  ã               @   sô   d dl Z d dlZd dlZd dlZd dlZd dlZd dlZd dlZd dl	Zddl
mZ e d¡Ze j ZejZejZejj ¡ ZdddhZdd	„ ZG d
d„ dejƒZG dd„ dejƒZG dd„ dejƒZG dd„ dejƒZG dd„ dejƒZ dd„ Z!dS )é    Né   )ÚMainz#(\s+|(?<=[\w!\"\'&.,?])-{2,}(?=\w))Z
warp_speedZtransporterZninjac             C   sx   | d krg S t j | ¡s"|  d¡} g }xL| D ]D}| ¡ }|dkrFt}q,|dkrTg }q,|tkrh| |¡ q,t|ƒ‚q,W |S )Nú,ÚallÚnone)ÚSConsÚUtilZis_ListÚsplitÚlowerÚdiskcheck_allÚappendÚ
ValueError)ÚvalueÚresultÚv© r   ú8lib/python3.7/site-packages/SCons/Script/SConsOptions.pyÚdiskcheck_convert.   s    

r   c               @   sX   e Zd ZdZdd„ Zdd„ Zdddd	d
dddddddddddddddddgZdd„ ZdS )ÚSConsValuesaÄ  
    Holder class for uniform access to SCons options, regardless
    of whether or not they can be set on the command line or in the
    SConscript files (using the SetOption() function).

    A SCons option value can originate three different ways:

        1)  set on the command line;
        2)  set in an SConscript file;
        3)  the default setting (from the the op.add_option()
            calls in the Parser() function, below).

    The command line always overrides a value set in a SConscript file,
    which in turn always overrides default settings.  Because we want
    to support user-specified options in the SConscript file itself,
    though, we may not know about all of the options when the command
    line is first parsed, so we can't make all the necessary precedence
    decisions at the time the option is configured.

    The solution implemented in this class is to keep these different sets
    of settings separate (command line, SConscript file, and default)
    and to override the __getattr__() method to check them in turn.
    This should allow the rest of the code to just fetch values as
    attributes of an instance of this class, without having to worry
    about where they came from.

    Note that not all command line options are settable from SConscript
    files, and the ones that are must be explicitly added to the
    "settable" list in this class, and optionally validated and coerced
    in the set_option() method.
    c             C   s   || _ i | _d S )N)Ú__defaults__Ú__SConscript_settings__)ÚselfÚdefaultsr   r   r   Ú__init__b   s    zSConsValues.__init__c             C   sv   y
| j | S  tk
rp   y| j d | S  tk
rj   yt| j d |ƒS  tk
rd   t|ƒ‚Y nX Y nX Y nX dS )zÑ
        Fetches an options value, checking first for explicit settings
        from the command line (which are direct attributes), then the
        SConscript file settings, then the default values.
        r   r   N)Ú__dict__ÚKeyErrorÚgetattrÚAttributeError)r   Úattrr   r   r   Ú__getattr__f   s    
zSConsValues.__getattr__ÚcleanÚ	diskcheckÚ	duplicateÚexperimentalÚhash_chunksizeÚhash_formatÚhelpÚimplicit_cacheÚimplicit_deps_changedÚimplicit_deps_unchangedÚ	max_driftÚmd5_chunksizeÚno_execÚno_progressÚnum_jobsÚrandomÚsilentÚ
stack_sizeÚwarnZdisable_execute_ninjaZdisable_ninjaZskip_ninja_regenc          
   C   sÆ  || j krtj d| ¡‚|dkrhyt|ƒ}|dk r8t‚W n( tk
rb   tj dt|ƒ ¡‚Y nX nP|dkrªyt|ƒ}W n( tk
r¤   tj dt|ƒ ¡‚Y nX n|dkryt|ƒ}W n( tk
rè   tj dt|ƒ ¡‚Y nX |tjj	j
kr
tj d	| ¡‚tjj	 |¡ nœ|d
kr†yt|ƒ}W n4 tk
rf } ztj d| ¡‚W dd}~X Y nX d
| jkr¸tjj	 |¡ n2|dkrÊyt|ƒ}W n* tk
rÆ   tj dt|ƒ ¡‚Y nX nî|dkryt|ƒ}W n* tk
r
   tj dt|ƒ ¡‚Y nX d}n¦|dkrPtj |¡r0|g}| j |g ¡| }tj |¡ nh|dkrltjjj d¡ nL|dkržtj |¡rŠ|g}| j |g ¡| }n|dkr¸|r¸d| jd< || j|< dS )zSets an option from an SConscript file.

        Raises:
            UserError: invalid or malformed option ("error in your script")
        z6This option is not settable from a SConscript file: %sr.   r   z"A positive integer is required: %sr*   zAn integer is required: %sr"   zA string is required: %sz!Not a valid duplication style: %sr!   zNot a valid diskcheck value: %sNr1   )r+   r$   r+   r2   r-   Fr#   )r(   r)   Tr'   )Úsettabler   ÚErrorsÚ	UserErrorÚintr   ÚreprÚstrÚNodeÚFSÚValid_DuplicatesÚset_duplicater   r   Zset_diskcheckr   Ú	is_Stringr   ÚgetÚWarningsZprocess_warn_stringsZScriptr   Zprogress_displayZset_mode)r   Únamer   r   r   r   r   Ú
set_optionž   s|    











zSConsValues.set_optionN)Ú__name__Ú
__module__Ú__qualname__Ú__doc__r   r   r3   rA   r   r   r   r   r   A   s4   r   c               @   sR   e Zd Zdd„ Zdd„ Zdd„ ZejjZedkr4g Zeeg Zejj	ejj
 Z	dS )ÚSConsOptionc                s:   |d k	r6ˆj dkrˆ ˆ |¡S t‡ ‡fdd„|D ƒƒS d S )N)r   ú?c                s   g | ]}ˆ  ˆ |¡‘qS r   )Úcheck_value)Ú.0r   )Úoptr   r   r   ú
<listcomp>ô   s    z-SConsOption.convert_value.<locals>.<listcomp>)ÚnargsrH   Útuple)r   rJ   r   r   )rJ   r   r   Úconvert_valueð   s    
zSConsOption.convert_valuec             C   s$   |   ||¡}|  | j| j||||¡S )N)rN   Ztake_actionÚactionÚdest)r   rJ   r   ÚvaluesÚparserr   r   r   Úprocessö   s    zSConsOption.processc             C   s.   | j dkr*| jr*d}tj || jd  ¡‚d S )NrG   z7option %s: nargs='?' is incompatible with short optionsr   )rL   Z_short_optsr   r4   r5   )r   Zfmtr   r   r   Ú_check_nargs_optional  s    z!SConsOption._check_nargs_optionalN)rB   rC   rD   rN   rS   rT   ÚoptparseÚOptionZCHECK_METHODSZCONST_ACTIONSZTYPED_ACTIONSr   r   r   r   rF   ï   s   
rF   c               @   s   e Zd ZdZdd„ ZdS )ÚSConsOptionGroupzó
    A subclass for SCons-specific option groups.

    The only difference between this and the base class is that we print
    the group's help text flush left, underneath their own title but
    lined up with the normal "SCons Options".
    c             C   s2   |  ¡  | | j¡}| ¡  |tj | |¡ }|S )z– Format an option group's help text.

        The title is dedented so it's flush with the "SCons Options"
        title we print at the top.
        )ÚdedentÚformat_headingÚtitleÚindentrU   ZOptionContainerÚformat_help)r   Ú	formatterr   r   r   r   r\     s
    zSConsOptionGroup.format_helpN)rB   rC   rD   rE   r\   r   r   r   r   rW     s   rW   c               @   s0   e Zd ZdZdd„ Zdd„ Zdd„ Zdd	„ Zd
S )ÚSConsOptionParserFc             C   s*   |   tj¡ tj d| ¡ t d¡ d S )NzSCons Error: %s
é   )Zprint_usageÚsysÚstderrÚwriteÚexit)r   Úmsgr   r   r   Úerror'  s    zSConsOptionParser.errorc             C   s¾  |  d¡}d|kr4| dd¡\}}| d|¡ d}n|}d}y*||  |¡krdt d||  |¡f ¡‚W n< tjk
r¢   | jrœ| j |¡ |r˜|  d¡ dS ‚ Y nX | j	| }| 
¡ rŒ|j}|dkrÞ|rÖ|  d¡}	n|j}	n¬t|ƒ|k rZ|dkrB|js|  td	ƒ| ¡ n.td
| ƒ}
|
tdd |j¡ ƒ7 }
|  |
¡ n|  tdƒ||f ¡ n0|dkrp|  d¡}	nt|d|… ƒ}	|d|…= n|r¦|  tdƒ| ¡ nd}	| ||	|| ¡ dS )aÈ   SCons-specific processing of long options.

        This is copied directly from the normal
        ``optparse._process_long_opt()`` method, except that, if configured
        to do so, we catch the exception thrown when an unknown option
        is encountered and just stick it back on the "leftover" arguments
        for later (re-)processing. This is because we may see the option
        definition later, while processing SConscript files.
        r   ú=r   TFz'%s'. Did you mean '%s'?NrG   z%s option requires an argumentz%s option requires an argument z(choose from %s)z, z%s option requires %d argumentsz%s option does not take a value)Úpopr	   ÚinsertZ_match_long_optrU   ZBadOptionErrorÚpreserve_unknown_optionsÚlargsr   Ú	_long_optZtakes_valuerL   ÚconstÚlenÚchoicesre   Ú_ÚjoinrM   rS   )r   ÚrargsrQ   ÚargrJ   Znext_argZhad_explicit_valueÚoptionrL   r   rd   r   r   r   Ú_process_long_opt-  sX    







z#SConsOptionParser._process_long_optc             C   sÜ   g }g }d}x°| j D ]¦}|r(| |¡ qt|ƒdkr|dd… dkr|f}d|kr^| dd¡}|d | jkr~| d |¡¡ qº| d |¡¡ q|dks |dkr°| |¡ d}q| |¡ qW |  || j¡ | j | | _ d	S )
a¦   Re-parse the leftover command-line options.

        Parse options stored in `self.largs`, so that any value
        overridden on the command line is immediately available
        if the user turns around and does a :func:`GetOption` right away.

        We mimic the processing of the single args
        in the original OptionParser :func:`_process_args`, but here we
        allow exact matches for long-opts only (no partial argument names!).
        Otherwise there could be  problems in :func:`add_local_option`
        below. When called from there, we try to reparse the
        command-line arguments that

        1. haven't been processed so far (`self.largs`), but
        2. are possibly not added to the list of options yet.

        So, when we only have a value for "--myargument" so far,
        a command-line argument of "--myarg=test" would set it,
        per the behaviour of :func:`_match_long_opt`,
        which allows for partial matches of the option name,
        as long as the common prefix appears to be unique.
        This would lead to further confusion, because we might want
        to add another option "--myarg" later on (see issue #2929).

        Fr_   r   z--rf   r   ú-TN)rj   r   rm   r	   rk   rp   Ú
parse_argsrQ   )r   rq   Zlargs_restoreÚskipÚlZloptr   r   r   Úreparse_local_optionsv  s&    
z'SConsOptionParser.reparse_local_optionsc             O   sj   y
| j }W n. tk
r8   t| dƒ}|  |¡}|| _ Y nX |j||Ž}|rft| jj|j|j	ƒ |  
¡  |S )a   Adds a local option to the parser.

        This is initiated by an :func:`AddOption` call to add a user-defined
        command-line option.  We add the option to a separate option
        group for the local options, creating the group if necessary.
        zLocal Options)Zlocal_option_groupr   rW   Zadd_option_groupÚ
add_optionÚsetattrrQ   r   rP   Údefaultry   )r   ÚargsÚkwÚgroupr   r   r   r   Úadd_local_optionµ  s    


	z"SConsOptionParser.add_local_optionN)rB   rC   rD   ri   re   rt   ry   r€   r   r   r   r   r^   $  s
   I?r^   c               @   s$   e Zd Zdd„ Zdd„ Zdd„ ZdS )ÚSConsIndentedHelpFormatterc             C   s   d| S )z Formats the usage message. z
usage: %s
r   )r   Úusager   r   r   Úformat_usageÕ  s    z'SConsIndentedHelpFormatter.format_usagec             C   s   |dkrd}t j | |¡S )zÜ Translates heading to "SCons Options"

        Heading of "Options" changed to "SCons Options."
        Unfortunately, we have to do this here, because those titles
        are hard-coded in the optparse calls.
        ZOptionszSCons Options)rU   ÚIndentedHelpFormatterrY   )r   Zheadingr   r   r   rY   Ù  s    z)SConsIndentedHelpFormatter.format_headingc             C   s  g }| j | }| j| j d }d}|jr2|  |¡}t|ƒ|krp|sptj| jddd}t	|_
| |¡d }| j}nd| jd||f }d}| |¡ |jrütj| jdd	}t	|_
| |¡}	| d
|d|	d f ¡ xD|	dd… D ]}
| d
| jd|
f ¡ qÜW n|d dkr| d¡ d |¡S )a˜   Customized option formatter.

        A copy of the normal ``optparse.IndentedHelpFormatter.format_option()``
        method.  This has been snarfed so we can modify text wrapping to
        our liking:

        * add our own regular expression that doesn't break on hyphens
          (so things like ``--no-print-directory`` don't get broken).
        * wrap the list of options themselves when it's too long
          (the ``wrapper.fill(opts)`` call below).
        * set the :attr:`subsequent_indent` when wrapping the :attr:`help_text`.

        The help for each option consists of two parts:

        * the opt strings and metavars e.g. ("-x", or
          "-fFILENAME, --file=FILENAME")
        * the user-supplied help string e.g.
          ("turn on expert mode", "read data from FILENAME")

        If possible, we write both of these on the same line::

          -x      turn on expert mode

        But if the opt string list is too long, we put the help
        string on a second line, indented to the same column it would
        start in if it fit on the first line::

          -fFILENAME, --file=FILENAME
                  read data from FILENAME
        r_   Fz  )ÚwidthZinitial_indentÚsubsequent_indentÚ
z	%*s%-*s  Ú r   )r…   r†   z%*s%s
r   Néÿÿÿÿ)Zoption_stringsZhelp_positionZcurrent_indentr&   Zexpand_defaultrm   ÚtextwrapZTextWrapperr…   Úno_hyphen_reZ
wordsep_reZfillr   Z
help_widthZwraprp   )r   rs   r   ZoptsZ	opt_widthZcombine_anywayZ	help_textÚwrapperZindent_firstZ
help_linesÚliner   r   r   Úformat_optionä  s4    




z(SConsIndentedHelpFormatter.format_optionN)rB   rC   rD   rƒ   rY   rŽ   r   r   r   r   r   Ô  s   r   c                s$  t  ¡ \}}td|d}ttd|dd}d|_| |_dd„ }|jd	d
dddddddddddd|td |jdddddddd |jdd d!d"d#g d$d%d&d'	 |jd(d!d)d*d+d,d-d. |jd/d0d1ddd2d |jd3d4d5ddd6d |jd7d8ddd9d |jd:d;ddd<d d=d>„ ‰ d?d@„ ‰dAdBdCg}dDdE 	|¡ }|jdFd!|dGdA|dHdI |jdJdKd*dLdMdNdO i }dPdQdRdSdTœ}	dUdVdWdXdYdZd[d\d]d^d_d`dadbg}
|
||	f‡ ‡fdcdd„	}dedE 	|
¡ }|jdfd!d"dgg d||dhdi	 djdk„ }|jdld!d"dmd*d|dndhdi	 ‡ fdodp„}dqdE 	t
jjj¡ }|jdrd!d"dVdsd||dt t
jjjsJ|jdudvddwdx dydz„ }|jd{d|dtƒ d}|d~d |jd€dd‚dƒd!d"d„g d$d…d†
 |jd‡dˆd‰dddŠd |jd‹dŒd‰ddŽ dd„ }|jd‘d’d!d“d”t
jjjjdd•|d–d—
 |jd˜d™d+dšdx |jd›dœddddžd |jdŸd d!d¡g d$d¢d&d. |jd£d¤dd¥dx |jd¦d§ddd¨d d©dª„ }|jd«d¬dd|d­d® |jd¯d°dd|d±d® |jd²d³d´dddµd |jd¶d·d!d“d¸d!d+d¹d–d'	 |jdºd»d¼ddd½d |jd¾d!d“d¿t
jjjd+dÀd–d' |jdÁdÂdÃdÄdÅdÆdddÇd	 |jdÈdÉdÊdËdx |jdÌd!dÍd*d+dÎd-d. |jdÏdÐdÑdddÒd |jdÓdÔdddÕd |jdÖd×dddØd |jdÙdÚdÛdÜdddÝd |jdÞd!dÉd*d+dßd&d. |jdàd!d“dád+dâd–dã |jdäd!dåd*d+dæd-d. dçdèdédêdëg}|f‡ fdìdí„	}dîdE 	|¡ }|jdïd!d"dðg d||dñdi	 |jdòdódôdKdõdLd!dödO |jd÷dKdõdLdødùdO dúdû„ }|jdüdýd|dþd |fdÿd „}|jddd!d"dg d|dddi
 |jdddd!d	g d$d
d dd„ }|jdddd!dddõd|tdt
 |jddd|td |jddd|td |jddd|td |jdddd!d"dg d|tdt
 |jdd!d"d|dtd  |jd!d|d"td# |jd$d%d&d'd|d(td# |jd)d!d"d*d|td+ |jd,d-d.d/d!d"d0d|td+
 |jd1d2d|td |S (3  ar  Returns a parser object initialized with the standard SCons options.

    Add options in the order we want them to show up in the ``-H`` help
    text, basically alphabetical.  Each ``op.add_option()`` call
    should have a consistent format::

      op.add_option("-L", "--long-option-name",
                    nargs=1, type="string",
                    dest="long_option_name", default='foo',
                    action="callback", callback=opt_long_option,
                    help="help text goes here",
                    metavar="VAR")

    Even though the :mod:`optparse` module constructs reasonable default
    destination names from the long option names, we're going to be
    explicit about each one for easier readability and so this code
    will at least show up when grepping the source for option attribute
    names, or otherwise browsing the source code.
    é   )Zmax_help_positionr…   Fz,usage: scons [OPTIONS] [VARIABLES] [TARGETS])Zoption_classZadd_help_optionr]   r‚   Tc             S   s   t j d| ¡ d S )NzWarning:  ignoring %s option
)r`   ra   rb   )rs   rJ   r   rR   r   r   r   Ú
opt_ignoreL  s    zParser.<locals>.opt_ignorez-bz-dz-ez-mz-Sz-tz-wz--environment-overridesz--no-keep-goingz--no-print-directoryz--print-directoryz--stopz--touchÚcallback)rO   r‘   r&   z-cz--cleanz--remover    Ú
store_truez)Remove specified targets and dependencies)rP   r|   rO   r&   z-Cz--directoryr   ÚstringZ	directoryr   z#Change to DIR before doing anythingZDIR)rL   ÚtyperP   r|   rO   r&   Úmetavarz--cache-debugZcache_debugNZstorez!Print CacheDir debug info to FILEZFILE)rL   rP   r|   rO   r&   r•   z--cache-disablez
--no-cacheZcache_disablez+Do not retrieve built targets from CacheDirz--cache-forcez--cache-populateZcache_forcez,Copy already-built targets into the CacheDirz--cache-readonlyZcache_readonlyz)Do not update CacheDir with built targetsz--cache-showZ
cache_showz+Print build actions for files from CacheDirc             S   s   d|| f }|dd  |¡  S )z%report an invalid option from a groupz)`%s' is not a valid %s option type, try:
z    %sz, )rp   )r   r   ZoptionsÚerrmsgr   r   r   Úopt_invalid€  s    zParser.<locals>.opt_invalidc             S   s   d|| f }|| S )z=report an invalid option from a group: recognized but removedz#`%s' is not a valid %s option type r   )r   r   rd   r–   r   r   r   Úopt_invalid_rm…  s    zParser.<locals>.opt_invalid_rmÚautoZforceÚcachez!Controls Configure subsystem [%s]z, z--configZconfigZMODE)rL   rn   rP   r|   r&   r•   z-DZclimb_upZstore_constr_   zDSearch up directory tree for SConstruct, build all Default() targets)rP   r|   rO   rl   r&   z#; please use --tree=derived insteadz; there is no replacementz&; please use --tree=all,status insteadz; please use --tree=all instead)ZdtreeZ
nomemoizerZstreeZtreeÚcountr"   ZexplainZfindlibsZincludesZmemoizerZmemoryZobjectsZpdbZprepareZpresubZ
stacktraceZtimezaction-timestampsc          	      sÒ   xÌ|  d¡D ]¾}||kr(|jj |¡ q||kr˜|jj |¡ y|jj W n tk
rf   g |j_Y nX || }d||f }	tjj|	f}
|jj |
¡ q||krº|| }t	ˆd||ƒƒ‚qt	ˆ d||ƒƒ‚qW d S )Nr   z&The --debug=%s option is deprecated%s.Údebug)
r	   rQ   rœ   r   Zdelayed_warningsr   r   r?   ZDeprecatedDebugOptionsWarningÚOptionValueError)rs   rJ   Zvalue__rR   Údebug_optionsÚdeprecated_debug_optionsÚremoved_debug_optionsr   rd   ÚwÚt)r—   r˜   r   r   Ú	opt_debug©  s$    zParser.<locals>.opt_debugz1Print various types of debugging information [%s]z--debugrœ   ZTYPE)rL   r”   rP   r|   rO   r‘   r&   r•   c          
   S   sP   yt |ƒ}W n. tk
r: } ztd| ƒ‚W d d }~X Y nX t|j| j|ƒ d S )Nz"`%s' is not a valid diskcheck type)r   r   r   r{   rQ   rP   )rs   rJ   r   rR   Zdiskcheck_valueÚer   r   r   Úopt_diskcheckÊ  s
    zParser.<locals>.opt_diskcheckz--diskcheckr!   zEnable specific on-disk checksc                sF   |t jjjkr$tˆ d|t jjjƒƒ‚t|j| j|ƒ t jj |¡ d S )NZduplication)	r   r9   r:   r;   r   r{   rQ   rP   r<   )rs   rJ   r   rR   )r—   r   r   Úopt_duplicateØ  s
    zParser.<locals>.opt_duplicatez*Set the preferred duplication methods [%s]z--duplicatezhard-soft-copy)rL   r”   rP   r|   rO   r‘   r&   z--enable-virtualenvZenable_virtualenvz,Import certain virtualenv variables to SCons)rP   rO   r&   c          	   S   s    t |j| jƒ}d|kr"| d¡}n|g}xb|D ]Z}|dkrBtƒ }q.|dkrPt}q.|tkr~td|d dd„ ttƒD ƒ¡f ƒ‚q.||hO }q.W t	|j| j|ƒ d S )Nr   r   r   zIoption --experimental: invalid choice: '%s' (choose from 'all','none',%s)c             S   s   g | ]}d | ‘qS )z'%s'r   )rI   r¤   r   r   r   rK     s    z9Parser.<locals>.experimental_callback.<locals>.<listcomp>)
r   rQ   rP   r	   ÚsetÚexperimental_featuresr   rp   Úsortedr{   )rs   rJ   r   rR   r#   r   r   r   r   Úexperimental_callbackð  s    
"z%Parser.<locals>.experimental_callbackz--experimentalr#   r8   zEnable experimental features)rP   rO   r|   r”   r‘   r&   z-fz--filez
--makefilez--sconstructÚfilez*Read FILE as the top-level SConstruct file)rL   r”   rP   r|   rO   r&   z-hz--helpr&   z'Print defined help message, or this onez-Hz--help-optionszPrint this message and exit)rO   r&   c             S   s2   |dkrt j t jjd| ¡ t|j| j|ƒ d S )Nz--md5-chunksizez9Parameter %s is deprecated. Use --hash-chunksize instead.)r   r?   r2   ZDeprecatedWarningr{   rQ   rP   )rs   rJ   r   rR   r   r   r   Úwarn_md5_chunksize_deprecated   s
    z-Parser.<locals>.warn_md5_chunksize_deprecatedz--hash-chunksizez--md5-chunksizer6   r+   z<Set chunk-size for hash signature computation to N kilobytesÚN)rL   r”   rP   r|   rO   r&   r‘   r•   z--hash-formatr%   z%Hash format [md5, sha1, sha256, etc].z-iz--ignore-errorsÚignore_errorsz Ignore errors from build actionsz-Iz--include-dirZinclude_dirz&Search DIR for imported Python modulesz--ignore-virtualenvZignore_virtualenvz+Do not import virtualenv variables to SConsz--implicit-cacher'   zCache implicit dependenciesc             S   s"   t |jddƒ t |j| jdƒ d S )Nr'   T)r{   rQ   rP   )rs   rJ   r   rR   r   r   r   Úopt_implicit_depsK  s    z!Parser.<locals>.opt_implicit_depsz--implicit-deps-changedr(   z#Ignore cached implicit dependencies)rP   r|   rO   r‘   r&   z--implicit-deps-unchangedr)   z'Ignore changes in implicit dependenciesz
--interactz--interactiveÚinteractivezRun in interactive modez-jz--jobsr.   zAllow N jobs at oncez-kz--keep-goingZ
keep_goingz&Keep going when a target can't be madez--max-driftr*   z+Set maximum system clock drift to N secondsz-nz	--no-execz--just-printz	--dry-runz--reconr,   z Don't build; just print commandsz--no-site-dirZsite_dirZstore_falsez,Don't search or use the usual site_scons dirz	--profileZprofile_filez%Profile SCons and put results in FILEz-qz
--questionZquestionz+Don't build; exit status says if up to datez-Qr-   z-Suppress "Reading/Building" progress messagesz--randomr/   z"Build dependencies in random orderz-sz--silentz--quietr0   zDon't print commandsz
--site-dirz+Use DIR instead of the usual site_scons dirz--stack-sizer1   zASet the stack size of the threads used to run jobs to N kilobytes)rL   r”   rP   rO   r&   r•   z--taskmastertraceZtaskmastertrace_filezTrace Node evaluation to FILEr   ÚderivedÚpruneÚstatusÚlinedrawc                sŽ   t  ¡ }xr| d¡D ]d}|dkr(d|_q|dkr8d|_q|dkrHd|_q|dkrXd|_q|dkrhd|_qtˆ d	||ƒƒ‚qW |jj	 
|¡ d S )
Nr   r   Fr±   Tr²   r³   r´   z--tree)r   ZTreePrinterr	   r±   r²   r³   Z	sLineDrawr   rQ   Útree_printersr   )rs   rJ   r   rR   Útree_optionsÚtpÚo)r—   r   r   Úopt_tree­  s    zParser.<locals>.opt_treez/Print a dependency tree in various formats [%s]z--treerµ   ZOPTIONSz-uz--upz--search-upr   zTSearch up directory tree for SConstruct, build targets at or below current directoryz-Ué   zVSearch up directory tree for SConstruct, build Default() targets from local SConscriptc             S   s    t j |jd ¡ t  d¡ d S )Nr‡   r   )r`   Ústdoutrb   Úversionrc   )rs   rJ   r   rR   r   r   r   Úopt_versionÔ  s    zParser.<locals>.opt_versionz-vz	--versionz'Print the SCons version number and exitc             S   s(   t j |¡r| d¡}|jj |¡ d S )Nr   )r   r   r=   r	   rQ   r2   Úextend)rs   rJ   r   rR   r¶   r   r   r   Úopt_warnÜ  s    
zParser.<locals>.opt_warnz--warnz	--warningr2   zEnable or disable warningszWARNING-SPECz-Yz--repositoryz--srcdirZ
repositoryz-Search REPOSITORY for source and target files)rL   rP   r|   rO   r&   c             S   s   d| }t j |¡ d S )Nz/Warning:  the %s option is not yet implemented
)r`   ra   rb   )rs   rJ   r   rR   rd   r   r   r   Úopt_not_yetó  s    zParser.<locals>.opt_not_yetz-lz--load-averagez
--max-loadÚfloatZload_averagez--list-actionsZlist_actions)rP   rO   r‘   r&   z--list-derivedZlist_derivedz--list-whereZ
list_wherez-oz
--old-filez--assume-oldZold_filez
--overrideÚoverride)rL   r”   rO   r‘   rP   r&   z-pÚp)rO   r‘   rP   r&   z-rz-Rz--no-builtin-rulesz--no-builtin-variablesZno_builtin_rulesz--write-filenamesZwrite_filenames)rL   r”   rP   rO   r‘   r&   z-Wz
--new-filez--assume-newz	--what-ifZnew_filez--warn-undefined-variablesZwarn_undefined_variables)ÚshutilÚget_terminal_sizer   r^   rF   ri   r¼   rz   ÚSUPPRESS_HELPrp   r   r9   r:   r;   ZPlatformZ
virtualenvZvirtualenv_enabled_by_defaultr§   ZFiler$   Zdefault_max_drift)r¼   ÚcolumnsÚlinesr]   Úopr   Zconfig_optionsZopt_config_helprŸ   r    rž   r£   Zopt_debug_helpr¥   r¦   Zopt_duplicate_helprª   r¬   r¯   r¶   r¹   Zopt_tree_helpr½   r¿   rÀ   r   )r—   r˜   r   ÚParser,  sz   

	












rÊ   )"ÚgettextrU   ÚrerÄ   r`   rŠ   ZSCons.Node.FSr   ZSCons.Platform.virtualenvZSCons.Warningsrˆ   r   Úcompiler‹   ro   r   rÆ   r9   r:   Zdiskcheck_typesr   r¨   r   ZValuesr   rV   rF   ZOptionGrouprW   ZOptionParserr^   r„   r   rÊ   r   r   r   r   Ú<module>   s0   

 / 1X