U e5d@sdZddddddddd d d d d ddddgZdZddlZddlZddlZddZzddlmZmZWn$e k rddZddZYnXeZ Gdd d e Z Gdd d e Z Gddde ZGddde ZGd dde ZGd!d"d"eZGd#d d ZGd$d d eZGd%d d eZd&d'Zd(d)Zee d*fee d*fee d+fee d,fd-Zd.d/Zd0dZd1ZGd2ddZd3Zd4ZGd5ddZ Gd6ddZ!Gd7dde!Z"Gd8dde!Z#d9d:Z$eZ%dS);z1.5.3Option make_option SUPPRESS_HELPSUPPRESS_USAGEValuesOptionContainer OptionGroup OptionParser HelpFormatterIndentedHelpFormatterTitledHelpFormatter OptParseError OptionErrorOptionConflictErrorOptionValueErrorBadOptionError check_choicea" Copyright (c) 2001-2006 Gregory P. Ward. All rights reserved. Copyright (c) 2002-2006 Python Software Foundation. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. * Neither the name of the author nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. NcCsd|jjt||fS)Nz<%s at 0x%x: %s>) __class____name__idselfr /usr/lib64/python3.8/optparse.py_reprOsr)gettextngettextcCs|SNr)messagerrrr\srcCs|dkr |S|SNr)ZsingularZpluralnrrrr_src@seZdZddZddZdS)r cCs ||_dSrmsgrr#rrr__init__hszOptParseError.__init__cCs|jSrr"rrrr__str__kszOptParseError.__str__Nr __module__ __qualname__r%r&rrrrr gsc@seZdZddZddZdS)r cCs||_t||_dSr)r#str option_id)rr#optionrrrr%uszOptionError.__init__cCs |jrd|j|jfS|jSdS)Nz option %s: %s)r+r#rrrrr&yszOptionError.__str__Nr'rrrrr osc@s eZdZdS)rNrr(r)rrrrrsc@s eZdZdS)rNr-rrrrrsc@seZdZddZddZdS)rcCs ||_dSr)opt_strrr.rrrr%szBadOptionError.__init__cCstd|jS)Nzno such option: %s)_r.rrrrr&szBadOptionError.__str__Nr'rrrrrsc@seZdZddZddZdS)AmbiguousOptionErrorcCst||||_dSr)rr% possibilities)rr.r2rrrr%s zAmbiguousOptionError.__init__cCstd|jd|jfS)Nzambiguous option: %s (%s?), )r0r.joinr2rrrrr&szAmbiguousOptionError.__str__Nr'rrrrr1sr1c@seZdZdZddZddZddZdd Zd d Zd d Z ddZ ddZ ddZ ddZ ddZddZddZddZddZd S)!r Znonec Csd|_||_|dkrLzttjd}Wnttfk rBd}YnX|d8}||_t|t |d|d|_ |_ d|_ d|_ d|_||_d|_i|_d|_d|_dS) NZCOLUMNSPrz%defaultz%s %sz%s=%s)parserindent_incrementintosenvironKeyError ValueErrorwidthminmax help_positionmax_help_positioncurrent_indentlevel help_width short_first default_tagoption_strings_short_opt_fmt _long_opt_fmtrr9rCr?rGrrrr%s&  zHelpFormatter.__init__cCs ||_dSr)r8rr8rrr set_parserszHelpFormatter.set_parsercCs&|dkrtd|d|d|_dS)N) z/invalid metavar delimiter for short options: %r%s)r>rJrZdelimrrrset_short_opt_delimiters z%HelpFormatter.set_short_opt_delimitercCs&|dkrtd|d|d|_dS)N)=rPz.invalid metavar delimiter for long options: %rrQ)r>rKrRrrrset_long_opt_delimiters z$HelpFormatter.set_long_opt_delimitercCs"|j|j7_|jd7_dSrrDr9rErrrrindentszHelpFormatter.indentcCs"|j|j8_|jd8_dSrrVrrrrdedentszHelpFormatter.dedentcCs tddSNzsubclasses must implementNotImplementedErrorrusagerrr format_usageszHelpFormatter.format_usagecCs tddSrYrZrZheadingrrrformat_headingszHelpFormatter.format_headingcCs.t|j|jd}d|j}tj||||dS)N rP)Zinitial_indentZsubsequent_indent)rAr?rDtextwrapZfill)rtextZ text_widthrWrrr _format_texts zHelpFormatter._format_textcCs|r||dSdSdSN rOrdr descriptionrrrformat_descriptionsz HelpFormatter.format_descriptioncCs|rd||dSdSdSrerg)repilogrrr format_epilogszHelpFormatter.format_epilogcCsP|jdks|js|jS|jj|j}|tks6|dkr<|j}|j|jt |Sr) r8rHhelpdefaultsgetdest NO_DEFAULTNO_DEFAULT_VALUEreplacer*)rr,Z default_valuerrrexpand_defaults zHelpFormatter.expand_defaultcsg}j|}jjd}t||krBdjd|f}j}ndjd||f}d}|||jr|}t|j }|d|d|df| fdd|ddDn|d d kr|d d |S) Nr6%*s%s rOz %*s%-*s rcsg|]}djd|fqS)rurO)rB).0linerrr Esz/HelpFormatter.format_option..r rf) rIrBrDlenappendrmrtrbZwraprFextendr4)rr,resultoptsZ opt_widthZ indent_firstZ help_textZ help_linesrrr format_option(s&       zHelpFormatter.format_optioncCs|d}|jD],}||}||j|<t|t||j}q||jD]8}|jD],}||}||j|<t|t||j}qXqN||t |d|j |_ t|j |j d|_ dS)Nrr6ra)rW option_listformat_option_stringsrIrArzrD option_groupsrXr@rCrBr?rF)rr8Zmax_lenoptZstringsgrouprrrstore_option_stringsKs        z"HelpFormatter.store_option_stringscst|rF|jp|jfdd|jD}fdd|jD}n |j}|j}jrb||}n||}d|S)Ncsg|]}j|fqSr)rJ)rvZsoptmetavarrrrrxasz7HelpFormatter.format_option_strings..csg|]}j|fqSr)rK)rvZloptrrrrxcsr3) takes_valuerrpupper _short_opts _long_optsrGr4)rr,Z short_optsZ long_optsr~rrrr]s   z#HelpFormatter.format_option_stringsN)rr(r)rrr%rNrSrUrWrXr^r`rdrjrlrtrrrrrrrr s +  #c@s&eZdZd ddZddZd d ZdS) r r6Nr cCst|||||dSrr r%rLrrrr%tszIndentedHelpFormatter.__init__cCs td|S)Nz Usage: %s )r0r\rrrr^|sz"IndentedHelpFormatter.format_usagecCsd|jd|fS)Nz%*s%s: rO)rDr_rrrr`sz$IndentedHelpFormatter.format_heading)r6rNr rr(r)r%r^r`rrrrr ps c@s&eZdZd ddZddZdd ZdS) r rrNcCst|||||dSrrrLrrrr%szTitledHelpFormatter.__init__cCsd|td|fS)Nz%s %s ZUsage)r`r0r\rrrr^sz TitledHelpFormatter.format_usagecCsd|d|jt|fS)Nz%s %s z=-)rErzr_rrrr`sz"TitledHelpFormatter.format_heading)rrNrrrrrrr s cCsh|dddkrd}nD|dddkrDd}|ddp@d}n|dddkrZd}nd}|||S) Nr6Z0xZ0b0r  )lower)valtyperadixrrr _parse_numsrcCs t|tSr)rr:)rrrr _parse_intsrZintegerzfloating-pointcomplex)r:longfloatrcCsHt|j\}}z ||WStk rBttd|||fYnXdS)Nzoption %s: invalid %s value: %r) _builtin_cvtrr>rr0)r,rvalueZcvtZwhatrrr check_builtins rcCs:||jkr|Sdtt|j}ttd|||fdS)Nr3z.option %s: invalid choice: %r (choose from %s))choicesr4mapreprrr0)r,rrrrrrrs )ZNOZDEFAULTc @seZdZddddddddd d d d g Zd ZdZdZdZdZdZ e e e e e dZ dZ ddZddZddZddZddZdd Zd!d"Zd#d$Zd%d&Zd'd(Zd)d*ZeeeeeeegZ d+d,ZeZd-d.Zd/d0Zd1d2Zd3d4Zd5d6Z d7d8Z!dS)9ractionrrpdefaultnargsconstrcallback callback_argscallback_kwargsrmr) store store_const store_true store_falser{ append_constcountrrmversion)rrrrr{rr)rr{r)rr{)rr)stringr:rrrchoice)r:rrrrNcOsBg|_g|_||}|||||jD] }||q0dSr)rr_check_opt_strings_set_opt_strings _set_attrs CHECK_METHODS)rr~attrscheckerrrrr%4s    zOption.__init__cCsdd|D}|std|S)NcSsg|] }|r|qSrr)rvrrrrrxKsz-Option._check_opt_strings..z+at least one option string must be supplied) TypeError)rr~rrrrGszOption._check_opt_stringscCs|D]}t|dkr$td||qt|dkrd|ddkrH|ddksVtd|||j|q|dddkr|ddkstd|||j|qdS) Nr6z>invalid option string %r: must be at least two characters longr-r zMinvalid short option string %r: must be of the form -x, (x any non-dash char)--zGinvalid long option string %r: must start with --, followed by non-dash)rzr rr{r)rr~rrrrrPs2  zOption._set_opt_stringscCsv|jD]F}||kr*t||||||=q|dkr@t||tqt||dq|rrt|}tdd||dS)Nrzinvalid keyword arguments: %sr3)ATTRSsetattrrqsortedkeysr r4)rrattrrrrres   zOption._set_attrscCs2|jdkrd|_n|j|jkr.td|j|dS)Nrzinvalid action: %r)rACTIONSr rrrr _check_actionxs  zOption._check_actioncCs|jdkr0|j|jkr|jdk r(d|_qd|_n^t|jtrF|jj|_|jdkrVd|_|j|jkrrtd|j||j|jkrtd|j|dS)Nrrr*zinvalid option type: %rz$must not supply a type for action %r) rrALWAYS_TYPED_ACTIONSr isinstancerTYPESr TYPED_ACTIONSrrrr _check_type~s         zOption._check_typecCsr|jdkrT|jdkr td|qnt|jttfsntdtt|jdd|n|jdk rntd|j|dS)Nrz/must supply a list of choices for type 'choice'z1choices must be a list of strings ('%s' supplied)'r z#must not supply choices for type %r)rrr rtuplelistr*splitrrrr _check_choices$   zOption._check_choicecCs\|j|jkp|jdk }|jdkrX|rX|jrH|jddddd|_n|jdd|_dS)Nrr6rr0r )r STORE_ACTIONSrrprrsr)rrrrr _check_dests zOption._check_destcCs*|j|jkr&|jdk r&td|j|dS)Nz*'const' must not be supplied for action %r)r CONST_ACTIONSrr rrrr _check_consts zOption._check_constcCs<|j|jkr|jdkr8d|_n|jdk r8td|j|dS)Nr z*'nargs' must not be supplied for action %r)rrrr rrrr _check_nargss   zOption._check_nargscCs|jdkrrt|js$td|j||jdk rJt|jtsJtd|j||jdk rt|jtstd|j|nB|jdk rtd|j||jdk rtd||jdk rtd|dS)Nrzcallback not callable: %rz3callback_args, if supplied, must be a tuple: not %rz4callback_kwargs, if supplied, must be a dict: not %rz.callback supplied (%r) for non-callback optionz.callback_args supplied for non-callback optionz0callback_kwargs supplied for non-callback option) rcallablerr rrrrdictrrrr_check_callbacksR         zOption._check_callbackcCsd|j|jS)N/)r4rrrrrrr&szOption.__str__cCs |jdk Sr)rrrrrrszOption.takes_valuecCs|jr|jdS|jdSdSNr)rrrrrrget_opt_strings zOption.get_opt_stringcCs*|j|j}|dkr|S||||SdSr) TYPE_CHECKERror)rrrrrrr check_valueszOption.check_valuecs:|dk r6jdkr|Stfdd|DSdS)Nr csg|]}|qSr)r)rvvrrrrrxsz(Option.convert_value..)rrr)rrrrrr convert_values  zOption.convert_valuecCs$|||}||j|j||||Sr)r take_actionrrp)rrrvaluesr8rrrprocesss zOption.processc Cs:|dkrt|||n|dkr2t|||jn|dkrHt||dn|dkr^t||dn|dkrz||g|n|dkr||g|jn|d krt||||d d n||d kr|jpd }|jpi}|j||||f||nF|dkr ||n*|dkr(| |nt d|j d S)NrrrTrFr{rrrr rrrmrzunknown action %r) rr ensure_valuer{rrr print_helpexit print_versionr>r) rrrprrrr8argskwargsrrrrs4      zOption.take_action)"rr(r)rrrrrrrrrrrr%rrrrrrrrrrr&r__repr__rrrrrrrrrrrsj       Z SUPPRESSHELPZ SUPPRESSUSAGEc@s^eZdZdddZddZeZddZdd Zd d Z d d Z dddZ dddZ ddZ dS)rNcCs&|r"|D]\}}t|||q dSr)itemsr)rrnrrrrrr%9szValues.__init__cCs t|jSr)r*__dict__rrrrr&>szValues.__str__cCs2t|tr|j|jkSt|tr*|j|kStSdSr)rrrrNotImplemented)rotherrrr__eq__Cs     z Values.__eq__cCs6t|D](}||kr||}|dk rt|||qdSr)dirr)rrrZdvalrrr_update_carefulKs  zValues._update_carefulcCs|j|dSr)rupdate)rrrrr _update_looseXszValues._update_loosecCs8|dkr||n |dkr(||n td|dS)NcarefulZloosezinvalid update mode: %r)rrr>)rrmoderrr_update`s   zValues._updatercCs&t|tj|}|t||dSr) __import__sysmodulesrvars)rmodnamermodrrr read_modulehs zValues.read_modulecCs&i}tt|||||dSr)execopenreadr)rfilenamerrrrr read_filemszValues.read_filecCs.t||rt||dkr$t|||t||Sr)hasattrgetattrr)rrrrrrrrs zValues.ensure_value)N)r)r)rr(r)r%r&rrrrrrrrrrrrrr7s    c@seZdZddZddZddZddZd d Zd d Zd dZ ddZ ddZ ddZ ddZ ddZddZddZddZdd Zd!S)"rcCs&|||_||||dSr)_create_option_list option_classset_conflict_handlerset_description)rrconflict_handlerrirrrr%s zOptionContainer.__init__cCsi|_i|_i|_dSr _short_opt _long_optrnrrrr_create_option_mappingssz'OptionContainer._create_option_mappingscCs|j|_|j|_|j|_dSrrrMrrr_share_option_mappingssz&OptionContainer._share_option_mappingscCs|dkrtd|||_dS)N)errorresolvez$invalid conflict_resolution value %r)r>r)rhandlerrrrrs z$OptionContainer.set_conflict_handlercCs ||_dSrrirhrrrrszOptionContainer.set_descriptioncCs|jSrr rrrrget_descriptionszOptionContainer.get_descriptioncCs|`|`|`dSrrrrrrdestroyszOptionContainer.destroycCsg}|jD]"}||jkr |||j|fq |jD]"}||jkr4|||j|fq4|r|j}|dkrtdddd|D|nd|dkr|D]V\}}|dr|j ||j|=n|j ||j|=|js|js|j j |qdS)Nr z conflicting option string(s): %sr3cSsg|] }|dqS)rr)rvcorrrrxsz3OptionContainer._check_conflict..r r) rrr{rrrrr4 startswithremove containerr)rr,Z conflict_optsrr Zc_optionrrr_check_conflicts2          zOptionContainer._check_conflictcOst|dtr|j||}n8t|dkrL|sL|d}t|tsTtd|ntd|||j|||_ |j D]}||j |<qv|j D]}||j |<q|jdk r|jtk r|j|j|j<n|j|jkrd|j|j<|S)Nrr znot an Option instance: %rinvalid arguments)rr*rrzrrrrr{rrrrrrprrqrn)rrrr,rrrr add_options(           zOptionContainer.add_optioncCs|D]}||qdSr)r)rrr,rrr add_optionsszOptionContainer.add_optionscCs|j|p|j|Sr)rrorr/rrr get_options  zOptionContainer.get_optioncCs||jkp||jkSr)rrr/rrr has_option s zOptionContainer.has_optioncCsn|j|}|dkr |j|}|dkr4td||jD] }|j|=q:|jD] }|j|=qN|jj|dS)Nzno such option %r) rrorr>rrrrr)rr.r,rrrr remove_options       zOptionContainer.remove_optioncCs>|js dSg}|jD]}|jtk r|||qd|SNrO)rrmrr{rr4)r formatterr}r,rrrformat_option_helps  z"OptionContainer.format_option_helpcCs||Sr)rjrrrrrrrj(sz"OptionContainer.format_descriptioncCs:g}|jr||||jr0|||d|S)Nrf)rir{rjrrr4rrr}rrr format_help+s zOptionContainer.format_helpN)rr(r)r%rr rrrrrrrrrrrrjr rrrrrxs      c@s6eZdZd ddZddZddZdd Zd d ZdS) rNcCs$||_t||j|j|||_dSr)r8rr%rrtitle)rr8r!rirrrr%6szOptionGroup.__init__cCsg|_||jdSr)rr r8rrrrr<szOptionGroup._create_option_listcCs ||_dSr)r!)rr!rrr set_title@szOptionGroup.set_titlecCst||`dSr)rrrrrrrrCs zOptionGroup.destroycCs0||j}||t||7}||Sr)r`r!rWrr rXrrrrr Js  zOptionGroup.format_help)N)rr(r)r%rr"rr rrrrr4s  c @s^eZdZgZddedddddddf ddZddZdd Zd d Zd d Z dOddZ ddZ ddZ ddZ ddZddZddZddZddZd d!Zd"d#Zd$d%Zd&d'ZdPd(d)Zd*d+Zd,d-Zd.d/Zd0d1Zd2d3Zd4d5Zd6d7Zd8d9ZdQd;d<Z d=d>Z!d?d@Z"dRdAdBZ#dCdDZ$dSdEdFZ%dTdGdHZ&dIdJZ'dUdKdLZ(dVdMdNZ)dS)WrNr Tc Csrt||||||| |_||_d|_d|_|dkr@t}||_|j || |_ |j ||d| dS)NT)add_help) rr% set_usageprograllow_interspersed_argsprocess_default_valuesr rrNrk_populate_option_list_init_parsing_state) rr]rrrrrirZadd_help_optionr%rkrrrr%s(   zOptionParser.__init__cCs.t||jD] }|q|`|`|`dSr)rrrrr)rrrrrrs    zOptionParser.destroycCsg|_g|_|dSr)rrrrrrrrsz OptionParser._create_option_listcCs|jdddtdddS)Nz-hz--helprmzshow this help message and exitrrmrr0rrrr_add_help_optionszOptionParser._add_help_optioncCs|jddtdddS)Nz --versionrz&show program's version number and exitr*r+rrrr_add_version_optionsz OptionParser._add_version_optioncCs>|jr||j|r |||jr.||r:|dSr)standard_option_listrrr-r,)rrr#rrrr(s  z"OptionParser._populate_option_listcCsd|_d|_d|_dSr)rargslargsrrrrrr)sz OptionParser._init_parsing_statecCsL|dkrtd|_n4|tkr$d|_n$|drB|dd|_n||_dS)Nz%prog [options]zusage: )r0r]rrrr\rrrr$s zOptionParser.set_usagecCs d|_dS)NTr&rrrrenable_interspersed_argssz%OptionParser.enable_interspersed_argscCs d|_dS)NFr2rrrrdisable_interspersed_argssz&OptionParser.disable_interspersed_argscCs ||_dSr)r')rrrrrset_process_default_values sz'OptionParser.set_process_default_valuescCs||j|<dSr)rn)rrprrrr set_defaultszOptionParser.set_defaultcKs|j|dSr)rnr)rrrrr set_defaultsszOptionParser.set_defaultscCs*|jdd}|jD]}||jq|Sr)rrr|)rZoptionsrrrr_get_all_optionss zOptionParser._get_all_optionscCs`|jst|jS|j}|D]4}||j}t|tr"| }| ||||j<q"t|Sr) r'rrncopyr8rorprr*rr)rrnr,rr.rrrget_default_valuess     zOptionParser.get_default_valuescOszt|dtr t|f||}nJt|dkrb|sb|d}t|tsNtd||j|k rjtdntd|j||S)Nrr znot an OptionGroup instance: %rz"invalid OptionGroup (wrong parser)r) rr*rrzrr8r>rr{)rrrrrrradd_option_group+s     zOptionParser.add_option_groupcCs0|j|p|j|}|r,|j|k r,|jSdSr)rrorr)rr.r,rrrget_option_group;s   zOptionParser.get_option_groupcCs&|dkrtjddS|ddSdSr)rargv)rrrrr _get_argsEszOptionParser._get_argsc Cs||}|dkr|}||_g|_}||_z||||}Wn4ttfk rv}z|t |W5d}~XYnX||}| ||Sr) r>r:r/r0r _process_argsrrr r* check_values)rrrr/r0stoperrrrr parse_argsKs    zOptionParser.parse_argscCs||fSrr)rrrrrrr@rs zOptionParser.check_valuescCs|r|d}|dkr|d=dS|dddkr<|||q|dddkrft|dkrf|||q|jr~|||d=qdSqdS)Nrrr6r r)_process_long_optrz_process_short_optsr&r{)rr0r/rargrrrr?s  zOptionParser._process_argscCs t||jSr) _match_abbrevr)rrrrr_match_long_optszOptionParser._match_long_optc Cs|d}d|kr4|dd\}}|d|d}n|}d}||}|j|}|r|j}t||kr|t dd|||dq|dkr|d} qt |d|} |d|=n|r|t d |nd} | || ||dS) NrrTr TF.%(option)s option requires %(number)d argument/%(option)s option requires %(number)d argumentsr,Znumberz%s option does not take a value) poprinsertrHrrrrzr rrr0r) rr/rrFrZnext_argZhad_explicit_valuer,rrrrrrDs6       zOptionParser._process_long_optc Cs|d}d}d}|ddD]}d|}|j|}|d7}|sJt||r|t|krv|d||dd}|j} t|| kr|t dd| || dq| dkr|d} qt |d| } |d| =nd} | || |||rqqdS) NrFr rTrIrJrK) rLrrorrrzrMrr rrr) rr/rrFrAiZchrr,rrrrrrEs<      z OptionParser._process_short_optscCs&|jdkrtjtjdS|jSdSr)r%r;pathbasenamerr=rrrr get_prog_names zOptionParser.get_prog_namecCs|d|S)Nz%prog)rsrQ)rsrrrexpand_prog_nameszOptionParser.expand_prog_namecCs ||jSr)rSrirrrrrszOptionParser.get_descriptionrcCs|rtj|t|dSr)rstderrwriter)rZstatusr#rrrrs zOptionParser.exitcCs(|tj|dd||fdS)Nr6z%s: error: %s ) print_usagerrTrrQr$rrrr s zOptionParser.errorcCs"|jr|j||jSdSdSr)r]rr^rSrrrr get_usage#s  zOptionParser.get_usagecCs|jrt||ddSN)file)r]printrWrrYrrrrV*s zOptionParser.print_usagecCs|jr||jSdSdSr)rrSrrrr get_version6s zOptionParser.get_versioncCs|jrt||ddSrX)rrZr\r[rrrr<szOptionParser.print_versioncCs|dkr|j}||g}||td||jrZ|t|||d|j D]}|| ||dq`| d |ddS)NZOptionsrfrOry) rrr{r`r0rWrrrrr rXr4)rrr}rrrrrGs    zOptionParser.format_option_helpcCs ||jSr)rlrkrrrrrlXszOptionParser.format_epilogcCsn|dkr|j}g}|jr*||d|jrD|||d||||||d|Sre) rr]r{rWrirjrrlr4rrrrr [szOptionParser.format_helpcCs |dkrtj}||dSr)rstdoutrUr r[rrrrgszOptionParser.print_help)T)NN)rN)N)N)N)N)N)*rr(r)r.rr%rrr,r-r(r)r$r3r4r5r6r7r8r:r;r<r>rCr@r?rHrDrErQrSrrr rWrVr\rrrlr rrrrrrRs`F "     ' 3 $)     csZ|kr Sfdd|D}t|dkr6|dS|sDtn|t|dS)Ncsg|]}|r|qSr)r)rvZwordrRrrrxs z!_match_abbrev..r r)rrzrsortr1)rRZwordmapr2rr^rrGts  rG)& __version____all__Z __copyright__rr;rbrrr ImportErrorr0 Exceptionr r rrrr1r r r rrrrrrrrqrrrrrrrrGrrrrrs    P      uA=&